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:
authorlovetox <philipp@hoerist.com>2020-04-18 10:50:12 +0300
committerlovetox <philipp@hoerist.com>2020-04-18 10:50:12 +0300
commit0dc661b5b969ee22da403eb6bd2863f8ce4b8b95 (patch)
treec3ad63dbc3cf0d6098b351be4aa1762e44096232
parent0783d91395d7441f9a0abb4aa93b520883c842ec (diff)
DiscoInfo: Add has_category() method
-rw-r--r--nbxmpp/structs.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py
index ea0c58e..64ce391 100644
--- a/nbxmpp/structs.py
+++ b/nbxmpp/structs.py
@@ -372,6 +372,12 @@ class DiscoInfo(namedtuple('DiscoInfo', 'stanza identities features dataforms ti
return identity.type
return None
+ def has_category(self, category):
+ for identity in self.identities:
+ if identity.category == category:
+ return True
+ return False
+
@property
def httpupload_max_file_size(self):
size = self.get_field_value(NS_HTTPUPLOAD_0, 'max-file-size')