From 7c9d90b0aac56f2890018dd8f2391808bff79583 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Tue, 8 Jul 2014 18:15:52 +0200 Subject: [PATCH] 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 file changed, 7 insertions(+), 11 deletions(-) diff --git a/js/ui/components/telepathyClient.js b/js/ui/components/telepathyClient.js index 320eb4a14..a62184d1d 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) {