comparison sat/core/xmpp.py @ 2892:82b781c46841

core: added a rosterResync method to bridge: rosterResync do a full resynchronisation of roster with server. This should not be needed, but may be useful if user suspect a sync issue for whatever reason.
author Goffi <goffi@goffi.org>
date Sun, 07 Apr 2019 18:49:41 +0200
parents 6a0f42e9410a
children c7c52c0dc13a
comparison
equal deleted inserted replaced
2891:6a0f42e9410a 2892:82b781c46841
1169 roster_jid_s = roster_jid.full() 1169 roster_jid_s = roster_jid.full()
1170 roster_item_elt = roster_item.toElement().toXml() 1170 roster_item_elt = roster_item.toElement().toXml()
1171 roster_cache[roster_jid_s] = roster_item_elt 1171 roster_cache[roster_jid_s] = roster_item_elt
1172 1172
1173 @defer.inlineCallbacks 1173 @defer.inlineCallbacks
1174 def resync(self):
1175 """Ask full roster to resync database
1176
1177 this should not be necessary, but may be used if user suspsect roster
1178 to be somehow corrupted
1179 """
1180 roster_cache = self.roster_cache
1181 yield roster_cache.clear()
1182 self._jids.clear()
1183 self._groups.clear()
1184 yield self.requestRoster()
1185
1186 @defer.inlineCallbacks
1174 def requestRoster(self): 1187 def requestRoster(self):
1175 """Ask the server for Roster list """ 1188 """Ask the server for Roster list """
1176 if self.versioning: 1189 if self.versioning:
1177 log.info(_(u"our server support roster versioning, we use it")) 1190 log.info(_(u"our server support roster versioning, we use it"))
1178 roster_cache = self.roster_cache 1191 roster_cache = self.roster_cache