diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-05-30 16:43:16 (GMT) |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2007-05-30 16:43:16 (GMT) |
commit | 22b1338ac5559e46136289711f5f7e91ec293839 (patch) | |
tree | 5f91fc70b3a14b892d3044ebfccb2bfc2264e7d6 | |
parent | b362ed625c6740385322bdfdf685a47e6fe625fb (diff) |
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.
-rw-r--r-- | services/presence/server_plugin.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/services/presence/server_plugin.py b/services/presence/server_plugin.py index 544e022..548b41f 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 |