I have a MyJabber class that runs the main jabber account, which prints incoming messages to stdout + and queues them.
The code that adds the client to the reactor is:
def addReactor(self):
print 'inside AddReactor'
factory = client.basicClientFactory(self.jid, self.option['jabber']['password'])
print "factory initialized"
factory.addBootstrap(xmlstream.STREAM_AUTHD_EVENT, self.authd)
print 'factory bootsraped'
reactor.connectTCP(self.option['jabber']['server'], 5222, factory)
it calls like this:
jabber = MyJabber(options, to_irc)
jabber.addReactor()
reactor.run()
When I launch the application, I see addReactor "print", but after that nothing more. I see something trying to connect to jabber.org through tcpdump, but nothing has to do with authd def:
def authd(self, xmlstream):
global thexmlstream
thexmlstream = xmlstream
print 'Initializing...'
presence = domish.Element(('jabber:client', 'presence'))
presence.addElement('status').addContent('Online')
xmlstream.send(presence)
print 'Add gotMessaged callback'
xmlstream.addObserver('/message', gotMessage)
print 'Add * callback'
xmlstream.addObserver('/*', gotSomething)
source
share