def connectionInitialized(self): """When connection is establised send presence and subscribe to the node that the bot is listening to. """ self.send(AvailablePresence()) self.subscribe(self.service, self.nodeIdentifier, self.getJid().userhostJID()) PubSubClient.connectionInitialized(self)
def connectionInitialized(self): """ Called when the XMPP connection has been established. Subscribe to all the nodes with the JID we connected with. """ PubSubClient.connectionInitialized(self) self._initialized = True subscriptions = self.store.query(PubSubSubscription) self._nodes = {} for subscription in subscriptions: self._subscribe(subscription.service, subscription.nodeIdentifier)
def connectionInitialized(self): log.msg('XMPP initialized') PubSubClient.connectionInitialized(self) # Create the gateway root node and registry self.gatewayRootId = self.parent.parent.gatewayId self.registryId = self.gatewayRootId + '/registry' self.createNode(self.parent.parent.xmppServerJID, self.gatewayRootId, {'pubsub#node_type':'collection'}).addErrback(self.printError) # TODO: make maxitems configurable self.createNode(self.parent.parent.xmppServerJID, self.registryId, {'pubsub#node_type':'leaf', 'pubsub#collection':self.gatewayRootId, 'pubsub#max_items':'100'} ).addErrback(self.printError) reactor.callLater(5, self.processMessages)
def __init__(self, myjid): PubSubClient.__init__(self)
def __init__(self, blog, service=None, node=None): PubSubClient.__init__(self) self.blog = blog self.service = service self.nodeIdentifier = node