changeset 4:66a7586e49f8

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 7eb4d15650dc
children 4c3e159abf0b
files wokkel/mam.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/mam.py	Thu Jan 15 21:02:41 2015 +0100
+++ b/wokkel/mam.py	Fri Apr 17 10:39:41 2015 +0200
@@ -200,8 +200,8 @@
         for attr in ('always', 'never'):
             attr_elt = mam_elt.addElement(attr)
             jids = getattr(self, attr)
-            for jid in jids:
-                attr_elt.addElement('jid', content=jid.full())
+            for jid_ in jids:
+                attr_elt.addElement('jid', content=jid_.full())
         return mam_elt
 
     def render(self, parent):
@@ -521,6 +521,8 @@
         iq.handled = True
 
     def getDiscoInfo(self, requestor, target, nodeIdentifier=''):
+        if nodeIdentifier:
+            return []
         return [disco.DiscoFeature(NS_MAM)]
 
     def getDiscoItems(self, requestor, target, nodeIdentifier=''):