Closed ekzyis closed 5 years ago
Editing function history()
to
.then(m => {
messages = m.array().reverse();
- update();
+ messages.forEach(m => show_message(m));
});
solves the most noticable issue when opening an empty channel, since then all messages will just be shown without using update()
which uses rl.write(NO_SEND)
to achieve persistence of user input after new arriving messages.
We don't need (or do we?) update()
in history()
since we only want to print the history in history()
without thinking about current user input since that is already handled by the working together of update()
, rl.on('line', {})
and client.on("message", {})
Changing printing of &$&no_send
in a new history after a new message arrived (from another member of from the user himself) cannot be changed as easily like in history()
since rl.write(NO_SEND)
in update()
was crucial to solving #11.
This should be fixed in https://github.com/xynxynxyn/terminal-discord/commit/a1a5e70baf451ed1c12c74b0672c66371282ed6c.
When entering a channel, on top of the history there is always the
NO_SEND
string (introduced in https://github.com/xynxynxyn/terminal-discord/commit/a573a9adc914769a7ace99ade6d55a9859888b9a due to https://github.com/xynxynxyn/terminal-discord/issues/11).Most of the times, when entering a channel with a big enough history, it gets unnoticed but when entering an empty channel, this output could be really confusing for the user.