paul-nameless / tg

terminal telegram client
The Unlicense
955 stars 74 forks source link

Marking messages as read #168

Open kovidgoyal opened 4 years ago

kovidgoyal commented 4 years ago

Thanks for the implementation of secret chats, it works well. The only issue is that messages received from the other party in the secret chat dont get marked as read. This means for instance with disappearing messages, the messages dont disappear. Note that there exists focus events for terminals that you can use to mark messages read when the window is focused. Or for a simpler implementation simply mark messages as read when the user starts typing/sends a message.

In a terminal you turn on focus reporting by sending <ESC>[1004h and turn it off with <ESC>[1004l. The terminal then sends <ESC>[I for focus gained and <ESC>[O for focus lost. https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-FocusIn_FocusOut

Ingvix commented 4 years ago

This is absolutely necessary to have before considering this as a viable alternative to Telegram Desktop.