Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
 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)
Ejemplo n.º 4
0
 def __init__(self, myjid):
     PubSubClient.__init__(self)
Ejemplo n.º 5
0
    def __init__(self, blog, service=None, node=None):
	PubSubClient.__init__(self)
        self.blog = blog
	self.service = service
	self.nodeIdentifier = node