changeset 33:c0f71fd5ed6b

tmp (wokkel/mam): restore MAMPrefs being callable without argument when constructing a query: - change occured in revision 1770 (81f9b53ec7e4)
author souliane <souliane@mailoo.org>
date Fri, 11 Mar 2016 16:39:39 +0100
parents cfee3d472359
children 213122b92b08
files wokkel/mam.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/mam.py	Tue Jan 19 14:59:13 2016 +0100
+++ b/wokkel/mam.py	Fri Mar 11 16:39:39 2016 +0100
@@ -88,10 +88,10 @@
     @itype rsm: L{rsm.RSMRequest}
 
     @ivar node: pubsub node id if querying a pubsub node, else None.
-    @itype form: C{unicode}
+    @itype node: C{unicode}
 
     @ivar query_id: id to use to track the query
-    @itype form: C{unicode}
+    @itype query_id: C{unicode}
     """
     # FIXME: should be based on generic.Stanza
 
@@ -178,8 +178,10 @@
     @type never: C{list}
     """
 
-    def __init__(self, default, always=None, never=None):
-        assert default in ('always', 'never', 'roster')
+    def __init__(self, default=None, always=None, never=None):
+        if default is not None:
+            # default must be defined in response, but can be empty in request (see http://xmpp.org/extensions/xep-0313.html#config)
+            assert default in ('always', 'never', 'roster')
         self.default = default
         if always is not None:
             assert isinstance(always, list)