comparison src/tmp/wokkel/mam.py @ 1413:e5393b12dd0f

tmp (mam): fixed name shadowing + getDiscoInfo for mam fix: getDiscoInfo now only returns MAM namespace when there is no node specified, this avoid having mam everywhere (which was causing issues in SàT PubSub's namespace delegation)
author Goffi <goffi@goffi.org>
date Fri, 17 Apr 2015 10:39:41 +0200
parents d9939b476526
children be1fccf4854d
comparison
equal deleted inserted replaced
1412:979210da778a 1413:e5393b12dd0f
198 if self.default: 198 if self.default:
199 mam_elt['default'] = self.default 199 mam_elt['default'] = self.default
200 for attr in ('always', 'never'): 200 for attr in ('always', 'never'):
201 attr_elt = mam_elt.addElement(attr) 201 attr_elt = mam_elt.addElement(attr)
202 jids = getattr(self, attr) 202 jids = getattr(self, attr)
203 for jid in jids: 203 for jid_ in jids:
204 attr_elt.addElement('jid', content=jid.full()) 204 attr_elt.addElement('jid', content=jid_.full())
205 return mam_elt 205 return mam_elt
206 206
207 def render(self, parent): 207 def render(self, parent):
208 """Embed the DOM representation of this MAM request in the given element. 208 """Embed the DOM representation of this MAM request in the given element.
209 209
519 519
520 self.resource.onPrefsSetRequest(prefs, requestor).addCallback(cb) 520 self.resource.onPrefsSetRequest(prefs, requestor).addCallback(cb)
521 iq.handled = True 521 iq.handled = True
522 522
523 def getDiscoInfo(self, requestor, target, nodeIdentifier=''): 523 def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
524 if nodeIdentifier:
525 return []
524 return [disco.DiscoFeature(NS_MAM)] 526 return [disco.DiscoFeature(NS_MAM)]
525 527
526 def getDiscoItems(self, requestor, target, nodeIdentifier=''): 528 def getDiscoItems(self, requestor, target, nodeIdentifier=''):
527 return [] 529 return []
528 530