diff options
author | Philipp Hörist <philipp@hoerist.com> | 2019-08-16 18:20:00 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2019-08-16 18:40:04 +0300 |
commit | 2f4a79e0e4722e605ecc85238a22584fe601088c (patch) | |
tree | f4191ce2707ac5d4f5a7d6c183ba21d911e78df0 /nbxmpp/structs.py | |
parent | 18c9fd5a0cc115dedaa201288c1d7e4bbba265aa (diff) |
DiscoInfo: Add serialize() method
Diffstat (limited to 'nbxmpp/structs.py')
-rw-r--r-- | nbxmpp/structs.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py index 5f9b1a8..2299a06 100644 --- a/nbxmpp/structs.py +++ b/nbxmpp/structs.py @@ -150,6 +150,11 @@ class DiscoInfo(namedtuple('DiscoInfo', 'stanza identities features dataforms ti def supports(self, feature): return feature in self.features + def serialize(self): + if self.stanza is None: + raise ValueError('Unable to serialize DiscoInfo, no stanza found') + return str(self.stanza) + @property def node(self): try: |