[polari/wip/fmuellner/window-experiments: 9/30] chatView: Remove pending marks on channel changes
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/window-experiments: 9/30] chatView: Remove pending marks on channel changes
- Date: Mon, 18 Jul 2016 12:45:35 +0000 (UTC)
commit 73d95ee22cf8437e4c5df42692082761f0d79164
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jun 10 22:42:00 2016 +0200
chatView: Remove pending marks on channel changes
src/chatView.js | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 703a36b..23260a7 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -709,6 +709,10 @@ const ChatView = new Lang.Class({
_pendingMessageRemoved: function(channel, message) {
let [id,] = message.get_pending_message_id();
+ this._removePendingMark(id);
+ },
+
+ _removePendingMark: function(id) {
let mark = this._pending.get(id);
if (!mark)
return;
@@ -893,6 +897,11 @@ const ChatView = new Lang.Class({
if (this._channel == this._room.channel)
return;
+ // Pending IDs are invalidated by channel changes, so
+ // remove marks to not get stuck on highlighted messages
+ for (let id of this._pending.entries())
+ this._removePendingMark(id);
+
if (this._channel) {
for (let i = 0; i < this._channelSignals.length; i++)
this._channel.disconnect(this._channelSignals[i]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]