diff options
author | Philipp Hörist <philipp@hoerist.com> | 2023-10-04 21:56:35 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2023-10-04 21:56:35 +0300 |
commit | 922813c89949cebb038bffda7cd81b15ab1ae7b1 (patch) | |
tree | 65d27befea81011e4aa79a34e694647c41fb7d95 | |
parent | e2f098a63fd7927670e87c4a7e022fa25cb6880e (diff) |
feat: Add DiscoInfo.has_identity()
-rw-r--r-- | nbxmpp/structs.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nbxmpp/structs.py b/nbxmpp/structs.py index 5c50911..c71f046 100644 --- a/nbxmpp/structs.py +++ b/nbxmpp/structs.py @@ -650,6 +650,13 @@ class DiscoInfo(NamedTuple): return True return False + def has_identity(self, category: str, type_: str) -> bool: + for identity in self.identities: + if (identity.category == category and + identity.type == type_): + return True + return False + @property def httpupload_max_file_size(self) -> Optional[float]: size = self.get_field_value(Namespace.HTTPUPLOAD_0, 'max-file-size') |