[polari] chatView: Don't insert pending message multiple times



commit d71c13289adcaa1464230f8b5d7cf517101ae6dd
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 6 20:20:59 2014 +0100

    chatView: Don't insert pending message multiple times
    
    The 'notify::channel' handler assumes that the signal is only
    emitted on actual property changes. However this assumption is
    wrong, as the property is set via g_object_set_property() which
    will always notify. So handle notifies without a value change
    by filtering out pending messages that have already been inserted
    previously.

 src/chatView.js |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index fd3e3b2..604e296 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -489,6 +489,9 @@ const ChatView = new Lang.Class({
 
         this._room.channel.dup_pending_messages().forEach(Lang.bind(this,
             function(message) {
+                let [id, ] = message.get_pending_message_id();
+                if (this._pending[id])
+                    return;
                 this._insertTpMessage(this._room, message);
             }));
         this._checkMessages();


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