changeset 3389:c3943afb4cac

core (xmpp): client.roster now implements __contains__ Now a jid can be tested directly with "entity_jid in client.roster".
author Goffi <goffi@goffi.org>
date Thu, 12 Nov 2020 14:53:15 +0100
parents cc288ec8ec1a
children 7d8a04a1d3a2
files sat/core/xmpp.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/sat/core/xmpp.py	Thu Nov 12 14:53:15 2020 +0100
+++ b/sat/core/xmpp.py	Thu Nov 12 14:53:15 2020 +0100
@@ -1303,6 +1303,9 @@
         self._jids = {}  # map from jids to RosterItem: key=jid value=RosterItem
         self._groups = {}  # map from groups to jids: key=group value=set of jids
 
+    def __contains__(self, entity_jid):
+        return self.isJidInRoster(entity_jid)
+
     @property
     def versioning(self):
         """True if server support roster versioning"""