[polari] chatView: Ignore acknowledged outgoing messages



commit f4b652b267f5b534f214c9fdd5e1b8e807df28d4
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Jul 31 03:44:37 2016 +0200

    chatView: Ignore acknowledged outgoing messages
    
    All outgoing messages have a pending ID of 0, which is also a valid ID
    for incoming messages. We don't create pending marks or notifications for
    outgoing messages, so don't remove another message's mark/notification
    when acknowledged.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=769355

 src/chatView.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index eadc083..4ebb439 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -712,10 +712,10 @@ const ChatView = new Lang.Class({
     },
 
     _pendingMessageRemoved: function(channel, message) {
-        let [id,] = message.get_pending_message_id();
-        let mark = this._pending.get(id);
-        if (!mark)
+        let [id, valid] = message.get_pending_message_id();
+        if (!valid || !this._pending.has(id))
             return;
+        let mark = this._pending.get(id);
         // Re-enable auto-scrolling if this is the most recent message
         if (this._view.buffer.get_iter_at_mark(mark).is_end())
             this._autoscroll = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]