Mercurial > libervia-backend
comparison src/core/xmpp.py @ 484:23cbdf0a0777
core: presence status + last resource refactored and kept in entitiesCache in memory.py, profile cache is purged on disconnection
author | Goffi <goffi@goffi.org> |
---|---|
date | Wed, 15 Aug 2012 15:50:46 +0200 |
parents | 2a072735e459 |
children | e789917fb59d |
comparison
equal
deleted
inserted
replaced
482:e0d1eed4a46b | 484:23cbdf0a0777 |
---|---|
247 | 247 |
248 if statuses.has_key(None): #we only want string keys | 248 if statuses.has_key(None): #we only want string keys |
249 statuses["default"] = statuses[None] | 249 statuses["default"] = statuses[None] |
250 del statuses[None] | 250 del statuses[None] |
251 | 251 |
252 self.host.memory.addPresenceStatus(entity, show or "", | 252 self.host.memory.setPresenceStatus(entity, show or "", |
253 int(priority), statuses, self.parent.profile) | 253 int(priority), statuses, self.parent.profile) |
254 | 254 |
255 #now it's time to notify frontends | 255 #now it's time to notify frontends |
256 self.host.bridge.presenceUpdate(entity.full(), show or "", | 256 self.host.bridge.presenceUpdate(entity.full(), show or "", |
257 int(priority), statuses, self.parent.profile) | 257 int(priority), statuses, self.parent.profile) |
263 statuses = {} | 263 statuses = {} |
264 | 264 |
265 if statuses.has_key(None): #we only want string keys | 265 if statuses.has_key(None): #we only want string keys |
266 statuses["default"] = statuses[None] | 266 statuses["default"] = statuses[None] |
267 del statuses[None] | 267 del statuses[None] |
268 self.host.memory.addPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile) | 268 self.host.memory.setPresenceStatus(entity, "unavailable", 0, statuses, self.parent.profile) |
269 | 269 |
270 #now it's time to notify frontends | 270 #now it's time to notify frontends |
271 self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile) | 271 self.host.bridge.presenceUpdate(entity.full(), "unavailable", 0, statuses, self.parent.profile) |
272 | 272 |
273 | 273 |