def _publish_channel_cb(self, channel): TelepathyPlugin._publish_channel_cb(self, channel) publish_handles, local_pending, remote_pending = \ self._publish_channel[CHANNEL_INTERFACE_GROUP].GetAllMembers() local_pending = self._filter_trusted_server(local_pending) if local_pending: # accept pending subscriptions # FIXME: do this async self._publish_channel[CHANNEL_INTERFACE_GROUP].AddMembers( local_pending, '') self._add_not_subscribed_to_subscribe_channel()
def _connected_cb(self): TelepathyPlugin._connected_cb(self) # request Friends group channel def friends_channel_requested_cb(friends_chan_path): self._friends_channel = Channel(self._conn.service_name, friends_chan_path) def error_requesting_friends_channel(e): _logger.debug('error requesting friends channel: %r' % e) handles = self._conn[CONN_INTERFACE].RequestHandles(HANDLE_TYPE_GROUP, ["Friends"]) self._conn[CONN_INTERFACE].RequestChannel(CHANNEL_TYPE_CONTACT_LIST, HANDLE_TYPE_GROUP, handles[0], True, reply_handler=friends_channel_requested_cb, error_handler=error_requesting_friends_channel)
def _publish_members_changed_cb(self, message, added, removed, local_pending, remote_pending, actor, reason): TelepathyPlugin._publish_members_changed_cb(self, message, added, removed, local_pending, remote_pending, actor, reason) local_pending = self._filter_trusted_server(local_pending) if local_pending: # accept all requested subscriptions self._publish_channel[CHANNEL_INTERFACE_GROUP].AddMembers( local_pending, '') # subscribe to people who've subscribed to us, if necessary if self._subscribe_channel is not None: added = list(set(added) - self._subscribe_members - self._subscribe_remote_pending) added = self._filter_trusted_server(added) if added: self._subscribe_channel[CHANNEL_INTERFACE_GROUP].AddMembers( added, '')
def __init__(self, registry, owner): TelepathyPlugin.__init__(self, registry, owner) self._friends_channel = None
def _subscribe_channel_cb(self, channel): TelepathyPlugin._subscribe_channel_cb(self, channel) self._add_not_subscribed_to_subscribe_channel()
def cleanup(self): TelepathyPlugin.cleanup(self) if self._watch is not None: self._watch.cancel() self._watch = None
def __init__(self, registry, owner): TelepathyPlugin.__init__(self, registry, owner)