[polari] properly check if we are invited to a room



commit 4b42726ef6bcb2660cbf976562bfab81baaac716
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Sat Oct 12 15:54:57 2013 -0400

    properly check if we are invited to a room
    
    The proper way to check if we have been invited to a room, is to check if our
    self contact is in local pending.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710011

 src/chatroomManager.js |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/chatroomManager.js b/src/chatroomManager.js
index 03c5e5a..e400c27 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -130,11 +130,14 @@ const _ChatroomManager = new Lang.Class({
 
         this._processRequest(context, connection, channels, Lang.bind(this,
             function(channel) {
-                // this is an invitation - only add it in handleChannel
-                // if accepted
-                if (channel.has_interface(Tp.IFACE_CHANNEL_INTERFACE_GROUP) &&
-                    channel.group_self_contact != null)
-                    return;
+                if (channel.has_interface(Tp.IFACE_CHANNEL_INTERFACE_GROUP)) {
+                    let [invited, , , ,] = 
channel.group_get_local_pending_contact_info(channel.group_self_contact);
+                    if (invited)
+                      // this is an invitation - only add it in handleChannel
+                      // if accepted
+                      return;
+                }
+
                 let room = this._ensureRoomForChannel(channel);
                 if (this.roomCount == 1)
                     this.setActiveRoom(room);


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