comparison idavoll/pubsub.py @ 58:3e2e0040e3e0

Return support for the pubsub#subscribe feature.
author Ralph Meijer <ralphm@ik.nu>
date Sat, 06 Nov 2004 16:02:32 +0000
parents 55fa890ef60b
children f6b7a06b8870
comparison
equal deleted inserted replaced
57:445a61f872b6 58:3e2e0040e3e0
195 def componentConnected(self, xmlstream): 195 def componentConnected(self, xmlstream):
196 xmlstream.addObserver(PUBSUB_SUBSCRIBE, self.onSubscribe) 196 xmlstream.addObserver(PUBSUB_SUBSCRIBE, self.onSubscribe)
197 xmlstream.addObserver(PUBSUB_UNSUBSCRIBE, self.onUnsubscribe) 197 xmlstream.addObserver(PUBSUB_UNSUBSCRIBE, self.onUnsubscribe)
198 xmlstream.addObserver(PUBSUB_OPTIONS_GET, self.onOptionsGet) 198 xmlstream.addObserver(PUBSUB_OPTIONS_GET, self.onOptionsGet)
199 xmlstream.addObserver(PUBSUB_OPTIONS_SET, self.onOptionsSet) 199 xmlstream.addObserver(PUBSUB_OPTIONS_SET, self.onOptionsSet)
200
201 def getFeatures(self, node):
202 features = []
203
204 if not node:
205 features.append(NS_PUBSUB + "#subscribe")
206
207 return features
200 208
201 def onSubscribe(self, iq): 209 def onSubscribe(self, iq):
202 self.handler_wrapper(self._onSubscribe, iq) 210 self.handler_wrapper(self._onSubscribe, iq)
203 211
204 def _onSubscribe(self, iq): 212 def _onSubscribe(self, iq):