# HG changeset patch # User Goffi # Date 1605189195 -3600 # Node ID c3943afb4cace78ff7090691a62ab65ae961d64a # Parent cc288ec8ec1a93e96c5c33c7292e2fded2f3eb69 core (xmpp): client.roster now implements __contains__ Now a jid can be tested directly with "entity_jid in client.roster". diff -r cc288ec8ec1a -r c3943afb4cac sat/core/xmpp.py --- 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"""