Mercurial > libervia-backend
comparison sat/core/xmpp.py @ 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 | dea30b1eb166 |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3388:cc288ec8ec1a | 3389:c3943afb4cac |
---|---|
1301 self.got_roster = defer.Deferred() # called when roster is received and ready | 1301 self.got_roster = defer.Deferred() # called when roster is received and ready |
1302 # XXX: the two following dicts keep a local copy of the roster | 1302 # XXX: the two following dicts keep a local copy of the roster |
1303 self._jids = {} # map from jids to RosterItem: key=jid value=RosterItem | 1303 self._jids = {} # map from jids to RosterItem: key=jid value=RosterItem |
1304 self._groups = {} # map from groups to jids: key=group value=set of jids | 1304 self._groups = {} # map from groups to jids: key=group value=set of jids |
1305 | 1305 |
1306 def __contains__(self, entity_jid): | |
1307 return self.isJidInRoster(entity_jid) | |
1308 | |
1306 @property | 1309 @property |
1307 def versioning(self): | 1310 def versioning(self): |
1308 """True if server support roster versioning""" | 1311 """True if server support roster versioning""" |
1309 return (NS_ROSTER_VER, 'ver') in self.parent.xmlstream.features | 1312 return (NS_ROSTER_VER, 'ver') in self.parent.xmlstream.features |
1310 | 1313 |