[gnome-shell] TelepathyClient: fix history trimming



commit 7c9d90b0aac56f2890018dd8f2391808bff79583
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Tue Jul 8 18:15:52 2014 +0200

    TelepathyClient: fix history trimming
    
    We need to put the actual actors in the history, not just the labels,
    otherwise all emptyLine (which are not messages but are not empty
    either) and all lines with a timestamp will get stuck in the scrollback.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733899

 js/ui/components/telepathyClient.js |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js
index 320eb4a..a62184d 100644
--- a/js/ui/components/telepathyClient.js
+++ b/js/ui/components/telepathyClient.js
@@ -863,13 +863,6 @@ const ChatNotification = new Lang.Class({
             for (let i = 0; i < expired.length; i++)
                 expired[i].actor.destroy();
         }
-
-        let groups = this._contentArea.get_children();
-        for (let i = 0; i < groups.length; i++) {
-            let group = groups[i];
-            if (group.get_n_children() == 0)
-                group.destroy();
-        }
     },
 
     /**
@@ -911,16 +904,19 @@ const ChatNotification = new Lang.Class({
             this._lastGroup = group;
             let emptyLine = new St.Label({ style_class: 'chat-empty-line' });
             this.addActor(emptyLine);
+            this._history.unshift({ actor: emptyLine, time: timestamp,
+                                    realMessage: false });
         }
 
-        this._lastMessageBox = new St.BoxLayout({ vertical: false });
-        this._lastMessageBox.add(body, props.childProps);
-        this.addActor(this._lastMessageBox);
+        let lineBox = new St.BoxLayout({ vertical: false });
+        lineBox.add(body, props.childProps);
+        this.addActor(lineBox);
+        this._lastMessageBox = lineBox;
 
         this.updated();
 
         let timestamp = props.timestamp;
-        this._history.unshift({ actor: body, time: timestamp,
+        this._history.unshift({ actor: lineBox, time: timestamp,
                                 realMessage: group != 'meta' });
 
         if (!props.noTimestamp) {


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