[polari/wip/fmuellner/3-24-1-candidates: 4/10] chatView: Disconnect channel when contact leaves from conversation
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/3-24-1-candidates: 4/10] chatView: Disconnect channel when contact leaves from conversation
- Date: Sun, 9 Apr 2017 20:07:23 +0000 (UTC)
commit 44bd27068f42062317e36da9a5c64a824e649636
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 f3f3c3b..a9365c6 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]