From c428e504fe9c369f3d9a44e9127350070e657bab Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 30 Aug 2021 10:27:24 +0200 Subject: [PATCH] Don't show unread marker for outgoing messages Closes: https://todo.sr.ht/~emersion/gamja/100 --- components/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/app.js b/components/app.js index f9ef89d..225cdf2 100644 --- a/components/app.js +++ b/components/app.js @@ -469,17 +469,25 @@ export default class App extends Component { this.setBufferState(bufID, (buf) => { // TODO: set unread if scrolled up let unread = buf.unread; + let prevReadReceipt = buf.prevReadReceipt; + if (this.state.activeBuffer !== buf.id) { unread = Unread.union(unread, msgUnread); } else { this.setReceipt(bufName, ReceiptType.READ, msg); } + + // Don't show unread marker for my own messages + if (client.isMyNick(msg.prefix.name)) { + prevReadReceipt = { time: msg.tags.time }; + } + this.bufferStore.put({ name: buf.name, server: client.params, unread, }); - return { unread }; + return { unread, prevReadReceipt }; }); }