diff options
author | lovetox <philipp@hoerist.com> | 2020-04-18 10:50:12 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2020-04-18 10:50:12 +0300 |
commit | 0dc661b5b969ee22da403eb6bd2863f8ce4b8b95 (patch) | |
tree | c3ad63dbc3cf0d6098b351be4aa1762e44096232 | |
parent | 0783d91395d7441f9a0abb4aa93b520883c842ec (diff) |
DiscoInfo: Add has_category() method
-rw-r--r-- | nbxmpp/structs.py | 6 |
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') |