Mercurial > libervia-backend
changeset 1911:3b75ab26f09b
tmp (wokkel/mam): restore MAMPrefs being callable without argument when constructing a query:
- change occured in revision 1770 (f525c272fd6d)
author | souliane <souliane@mailoo.org> |
---|---|
date | Fri, 11 Mar 2016 16:39:39 +0100 |
parents | 55440ee00905 |
children | c38bcc0343b6 |
files | src/tmp/wokkel/mam.py |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/tmp/wokkel/mam.py Fri Mar 11 17:42:56 2016 +0100 +++ b/src/tmp/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)