[polari] chatView: Disconnect channel when contact leaves from conversation



commit 1f721d943dbf6b8215885e4b49d9b10de4f11c9c
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Oct 6 02:40:30 2016 +0200

    chatView: Disconnect channel when contact leaves from conversation
    
    In a one-to-one conversation, there's no reason to keep the channel
    open after one of the participants disconnects - all further messages
    will go straight to /dev/null anyway - so disconnect the channel in
    this case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712635

 src/chatView.js |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index ad0093a..870d2e3 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -1331,6 +1331,13 @@ const ChatView = new Lang.Class({
     },
 
     _onNickStatusChanged: function(baseNick, status) {
+        if (this._room.type == Tp.HandleType.CONTACT &&
+            status == Tp.ConnectionPresenceType.OFFLINE &&
+            this._room.channel)
+            this._room.channel.ack_all_pending_messages_async(() => {
+                this._room.channel.close_async(null);
+            });
+
         let nickTagName = this._getNickTagName(baseNick);
         let nickTag = this._lookupTag(nickTagName);
 


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