# HG changeset patch # User Ralph Meijer # Date 1207746939 0 # Node ID 17fc5dd77158e5adef1650c7b46b5b0494f324d6 # Parent bd86f0c3fd3915498c9c73827358d17b200e8bca Move around service setup. diff -r bd86f0c3fd39 -r 17fc5dd77158 idavoll/tap.py --- a/idavoll/tap.py Wed Apr 09 13:02:29 2008 +0000 +++ b/idavoll/tap.py Wed Apr 09 13:15:39 2008 +0000 @@ -40,18 +40,7 @@ def makeService(config): s = service.MultiService() - cs = Component(config["rhost"], int(config["rport"]), - config["jid"], config["secret"]) - cs.setServiceParent(s) - - cs.factory.maxDelay = 900 - - if config["verbose"]: - cs.logTraffic = True - - FallbackHandler().setHandlerParent(cs) - VersionHandler('Idavoll', __version__).setHandlerParent(cs) - DiscoHandler().setHandlerParent(cs) + # Create backend service with storage if config['backend'] == 'pgsql': from idavoll.pgsql_storage import Storage @@ -67,6 +56,21 @@ bs = BackendService(st) bs.setServiceParent(s) + # Set up XMPP server-side component with publish-subscribe capabilities + + cs = Component(config["rhost"], int(config["rport"]), + config["jid"], config["secret"]) + cs.setServiceParent(s) + + cs.factory.maxDelay = 900 + + if config["verbose"]: + cs.logTraffic = True + + FallbackHandler().setHandlerParent(cs) + VersionHandler('Idavoll', __version__).setHandlerParent(cs) + DiscoHandler().setHandlerParent(cs) + ps = IPubSubService(bs) ps.setHandlerParent(cs) ps.hideNodes = config["hide-nodes"]