diff options
Diffstat (limited to 'nbxmpp/protocol.py')
-rw-r--r-- | nbxmpp/protocol.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/nbxmpp/protocol.py b/nbxmpp/protocol.py index 6f6cc6e..6833284 100644 --- a/nbxmpp/protocol.py +++ b/nbxmpp/protocol.py @@ -1709,10 +1709,15 @@ class Features(Node): def has_sasl(self): return self.getTag('mechanisms', namespace=Namespace.SASL) is not None + def has_sasl_2(self): + return self.getTag('mechanisms', namespace=Namespace.SASL2) is not None + def get_mechs(self) -> set[str]: - mechanisms = self.getTag('mechanisms', namespace=Namespace.SASL) + mechanisms = self.getTag('mechanisms', namespace=Namespace.SASL2) if mechanisms is None: - return set() + mechanisms = self.getTag('mechanisms', namespace=Namespace.SASL) + if mechanisms is None: + return set() mechanisms = mechanisms.getTags('mechanism') return set(mech.getData() for mech in mechanisms) |