From 922813c89949cebb038bffda7cd81b15ab1ae7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Wed, 4 Oct 2023 20:56:35 +0200 Subject: feat: Add DiscoInfo.has_identity() --- nbxmpp/structs.py | 7 +++++++ 1 file changed, 7 insertions(+) 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') -- cgit v1.2.3