comparison frontends/src/quick_frontend/quick_app.py @ 1342:e31a07a5614d frontends_multi_profiles

quick_frontends, primitivus (contact list): added nick observer + implemented onNickUpdate
author Goffi <goffi@goffi.org>
date Tue, 24 Feb 2015 17:14:10 +0100
parents 18cd46a264e9
children b26dd78de495
comparison
equal deleted inserted replaced
1341:6dbeb2ef966c 1342:e31a07a5614d
311 311
312 /!\ don't forget to remove listener when not used anymore (e.g. if you delete a widget) 312 /!\ don't forget to remove listener when not used anymore (e.g. if you delete a widget)
313 @param type_: type of event, can be: 313 @param type_: type of event, can be:
314 - avatar: called when avatar data is updated 314 - avatar: called when avatar data is updated
315 args: (entity, avatar file, profile) 315 args: (entity, avatar file, profile)
316 - nick: called when nick data is updated
317 args: (entity, new_nick, profile)
316 - presence: called when a presence is received 318 - presence: called when a presence is received
317 args: (entity, show, priority, statuses, profile) 319 args: (entity, show, priority, statuses, profile)
318 @param callback: method to call on event 320 @param callback: method to call on event
319 @param profiles_filter (set[unicode]): if set and not empty, the 321 @param profiles_filter (set[unicode]): if set and not empty, the
320 listener will be callable only by one of the given profiles. 322 listener will be callable only by one of the given profiles.
683 def entityDataUpdatedHandler(self, entity_s, key, value, profile): 685 def entityDataUpdatedHandler(self, entity_s, key, value, profile):
684 entity = jid.JID(entity_s) 686 entity = jid.JID(entity_s)
685 if key == "nick": 687 if key == "nick":
686 if entity in self.contact_lists[profile]: 688 if entity in self.contact_lists[profile]:
687 self.contact_lists[profile].setCache(entity, 'nick', value) 689 self.contact_lists[profile].setCache(entity, 'nick', value)
690 self.callListeners('nick', entity, value, profile=profile)
688 elif key == "avatar": 691 elif key == "avatar":
689 if entity in self.contact_lists[profile]: 692 if entity in self.contact_lists[profile]:
690 def gotFilename(filename): 693 def gotFilename(filename):
691 self.contact_lists[profile].setCache(entity, 'avatar', filename) 694 self.contact_lists[profile].setCache(entity, 'avatar', filename)
692 self.callListeners('avatar', entity, filename, profile=profile) 695 self.callListeners('avatar', entity, filename, profile=profile)