Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/python-nbxmpp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2019-08-16 18:20:00 +0300
committerPhilipp Hörist <philipp@hoerist.com>2019-08-16 18:40:04 +0300
commit2f4a79e0e4722e605ecc85238a22584fe601088c (patch)
treef4191ce2707ac5d4f5a7d6c183ba21d911e78df0 /nbxmpp/structs.py
parent18c9fd5a0cc115dedaa201288c1d7e4bbba265aa (diff)
DiscoInfo: Add serialize() method
Diffstat (limited to 'nbxmpp/structs.py')
-rw-r--r--nbxmpp/structs.py5
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: