comparison sat_pubsub/tap.py @ 278:8a71486c3e95

implements RSM (XEP-0059)
author souliane <souliane@mailoo.org>
date Mon, 13 Oct 2014 14:53:42 +0200
parents b757c29b20d7
children 798cb8962c0b
comparison
equal deleted inserted replaced
277:e749401be529 278:8a71486c3e95
58 58
59 from wokkel.component import Component 59 from wokkel.component import Component
60 from wokkel.disco import DiscoHandler 60 from wokkel.disco import DiscoHandler
61 from wokkel.generic import FallbackHandler, VersionHandler 61 from wokkel.generic import FallbackHandler, VersionHandler
62 from wokkel.iwokkel import IPubSubResource 62 from wokkel.iwokkel import IPubSubResource
63 from wokkel.pubsub import PubSubService 63 from wokkel import pubsub, rsm
64 64
65 from sat_pubsub import __version__ 65 from sat_pubsub import __version__, const
66 from sat_pubsub.backend import BackendService 66 from sat_pubsub.backend import BackendService
67 from sat_pubsub.remote_roster import RosterClient 67 from sat_pubsub.remote_roster import RosterClient
68 68
69 class Options(usage.Options): 69 class Options(usage.Options):
70 optParameters = [ 70 optParameters = [
139 139
140 resource = IPubSubResource(bs) 140 resource = IPubSubResource(bs)
141 resource.hideNodes = config["hide-nodes"] 141 resource.hideNodes = config["hide-nodes"]
142 resource.serviceJID = config["jid"] 142 resource.serviceJID = config["jid"]
143 143
144 ps = PubSubService(resource) 144 ps = (rsm if const.FLAG_ENABLE_RSM else pubsub).PubSubService(resource)
145 ps.setHandlerParent(cs) 145 ps.setHandlerParent(cs)
146 resource.pubsubService = ps 146 resource.pubsubService = ps
147 147
148 rc = RosterClient() 148 rc = RosterClient()
149 rc.setHandlerParent(cs) 149 rc.setHandlerParent(cs)