From 2f4a79e0e4722e605ecc85238a22584fe601088c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Fri, 16 Aug 2019 17:20:00 +0200 Subject: DiscoInfo: Add serialize() method --- nbxmpp/structs.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nbxmpp/structs.py') 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: -- cgit v1.2.3