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>2023-10-04 21:56:35 +0300
committerPhilipp Hörist <philipp@hoerist.com>2023-10-04 21:56:35 +0300
commit922813c89949cebb038bffda7cd81b15ab1ae7b1 (patch)
tree65d27befea81011e4aa79a34e694647c41fb7d95
parente2f098a63fd7927670e87c4a7e022fa25cb6880e (diff)
feat: Add DiscoInfo.has_identity()
-rw-r--r--nbxmpp/structs.py7
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')