From 22b1338ac5559e46136289711f5f7e91ec293839 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 30 May 2007 17:43:16 +0100 Subject: [PATCH] services/presence/server_plugin: special-case the Owner when IDing buddies. We always know who we are, so don't need to inspect our own handle or anything. --- services/presence/server_plugin.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/services/presence/server_plugin.py b/services/presence/server_plugin.py index 544e0220..548b41fd 100644 --- a/services/presence/server_plugin.py +++ b/services/presence/server_plugin.py @@ -1131,20 +1131,27 @@ class ServerPlugin(gobject.GObject): owners = handles if tp_chan is not None and CHANNEL_INTERFACE_GROUP in tp_chan: - group = tp_chan[CHANNEL_INTERFACE_GROUP] - if group.GetFlags() & CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES: - + if (group.GetGroupFlags() & + CHANNEL_GROUP_FLAG_CHANNEL_SPECIFIC_HANDLES): owners = group.GetHandleOwners(handles) for i, owner in enumerate(owners): if owner == 0: owners[i] = handles[i] + else: + group = None jids = self._conn[CONN_INTERFACE].InspectHandles(HANDLE_TYPE_CONTACT, owners) ret = {} for handle, jid in zip(handles, jids): + # special-case the Owner - we always know who we are + if (handle == self.self_handle or + (group is not None and handle == group.GetSelfHandle())): + ret[handle] = self._owner.props.objid + continue + if '/' in jid: # the contact is unidentifiable (in an anonymous MUC) - create # a temporary identity for them, based on their room-JID