comparison src/plugins/plugin_xep_0054.py @ 1315:be3a301540c0 frontends_multi_profiles

core (memory): updateEntityData now accept a "silent" argument to avoid sending signal to frontends when updating an attribute with "signalOnUpdate" flag.
author Goffi <goffi@goffi.org>
date Mon, 09 Feb 2015 21:39:51 +0100
parents 0541cb64217e
children bd69d341d969
comparison
equal deleted inserted replaced
1314:bb9c32249778 1315:be3a301540c0
103 # the current naive approach keeps a map between all jids of all profiles 103 # the current naive approach keeps a map between all jids of all profiles
104 # in persistent cache, then put avatar 104 # in persistent cache, then put avatar
105 # hashs in memory. Hashed should be shared between profiles 105 # hashs in memory. Hashed should be shared between profiles
106 for jid_s, avatar_hash in self.avatars_cache.iteritems(): 106 for jid_s, avatar_hash in self.avatars_cache.iteritems():
107 jid_ = jid.JID(jid_s) 107 jid_ = jid.JID(jid_s)
108 self.host.memory.updateEntityData(jid_, "avatar", avatar_hash, profile) 108 self.host.memory.updateEntityData(jid_, "avatar", avatar_hash, silent=True, profile_key=profile)
109 109
110 @defer.inlineCallbacks 110 @defer.inlineCallbacks
111 def profileConnected(self, profile): 111 def profileConnected(self, profile):
112 yield self.initialised 112 yield self.initialised
113 self._fillCachedValues(profile) 113 self._fillCachedValues(profile)
120 @param name: name of the item which changed 120 @param name: name of the item which changed
121 @param value: new value of the item 121 @param value: new value of the item
122 @param profile: profile which received the update 122 @param profile: profile which received the update
123 """ 123 """
124 assert not jid_.resource # VCard are retrieved with bare jid 124 assert not jid_.resource # VCard are retrieved with bare jid
125 self.host.memory.updateEntityData(jid_, name, value, profile) 125 self.host.memory.updateEntityData(jid_, name, value, profile_key=profile)
126 if name == "avatar": 126 if name == "avatar":
127 self.avatars_cache[jid_.userhost()] = value 127 self.avatars_cache[jid_.userhost()] = value
128 128
129 def getCache(self, entity_jid, name, profile): 129 def getCache(self, entity_jid, name, profile):
130 """return cached value for jid 130 """return cached value for jid