Mercurial > libervia-backend
comparison src/memory/disco.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 | faa1129559b8 |
children | 069ad98b360d |
comparison
equal
deleted
inserted
replaced
1314:bb9c32249778 | 1315:be3a301540c0 |
---|---|
105 except (KeyError, exceptions.UnknownEntityError): | 105 except (KeyError, exceptions.UnknownEntityError): |
106 # capability hash is not available, we'll compute one | 106 # capability hash is not available, we'll compute one |
107 def infosCb(disco_infos): | 107 def infosCb(disco_infos): |
108 cap_hash = self.generateHash(disco_infos) | 108 cap_hash = self.generateHash(disco_infos) |
109 self.hashes[cap_hash] = disco_infos | 109 self.hashes[cap_hash] = disco_infos |
110 self.host.memory.updateEntityData(jid_, C.ENTITY_CAP_HASH, cap_hash, client.profile) | 110 self.host.memory.updateEntityData(jid_, C.ENTITY_CAP_HASH, cap_hash, profile_key=client.profile) |
111 return disco_infos | 111 return disco_infos |
112 d = client.disco.requestInfo(jid_) | 112 d = client.disco.requestInfo(jid_) |
113 d.addCallback(infosCb) | 113 d.addCallback(infosCb) |
114 return d | 114 return d |
115 else: | 115 else: |
133 items = self.host.memory.getEntityData(jid_, ["DISCO_ITEMS"], client.profile)["DISCO_ITEMS"] | 133 items = self.host.memory.getEntityData(jid_, ["DISCO_ITEMS"], client.profile)["DISCO_ITEMS"] |
134 log.debug("[%s] disco items are in cache" % jid_.full()) | 134 log.debug("[%s] disco items are in cache" % jid_.full()) |
135 except (KeyError, exceptions.UnknownEntityError): | 135 except (KeyError, exceptions.UnknownEntityError): |
136 log.debug("Caching [%s] disco items" % jid_.full()) | 136 log.debug("Caching [%s] disco items" % jid_.full()) |
137 items = yield client.disco.requestItems(jid_, nodeIdentifier) | 137 items = yield client.disco.requestItems(jid_, nodeIdentifier) |
138 self.host.memory.updateEntityData(jid_, "DISCO_ITEMS", items, client.profile) | 138 self.host.memory.updateEntityData(jid_, "DISCO_ITEMS", items, profile_key=client.profile) |
139 else: | 139 else: |
140 items = yield client.disco.requestItems(jid_, nodeIdentifier) | 140 items = yield client.disco.requestItems(jid_, nodeIdentifier) |
141 | 141 |
142 defer.returnValue(items) | 142 defer.returnValue(items) |
143 | 143 |