# HG changeset patch # User Goffi # Date 1424793164 -3600 # Node ID 18cd46a264e91979a778044f1a8e1d93e4c43b86 # Parent 139263ee85c5868a0a1bcf548a8e9f58f780dde0 quick frontends, primitivus: fixed listener calls (kwargs where forgotten) + fixed presence listener + renamed updatePresence to onPresenceUpdate for consistency with oter listeners diff -r 139263ee85c5 -r 18cd46a264e9 frontends/src/primitivus/contact_list.py --- a/frontends/src/primitivus/contact_list.py Tue Feb 24 14:40:19 2015 +0100 +++ b/frontends/src/primitivus/contact_list.py Tue Feb 24 16:52:44 2015 +0100 @@ -148,8 +148,8 @@ self.update() self._emit('click', entity) - def updatePresence(self, entity, show, priority, statuses): - super(ContactList, self).updatePresence(entity, show, priority, statuses) + def onPresenceUpdate(self, entity, show, priority, statuses, profile): + super(ContactList, self).onPresenceUpdate(entity, show, priority, statuses, profile) self.update() # Methods to build the widget diff -r 139263ee85c5 -r 18cd46a264e9 frontends/src/quick_frontend/quick_app.py --- a/frontends/src/quick_frontend/quick_app.py Tue Feb 24 14:40:19 2015 +0100 +++ b/frontends/src/quick_frontend/quick_app.py Tue Feb 24 16:52:44 2015 +0100 @@ -349,7 +349,7 @@ profile = kwargs.get("profile") for listener, profiles_filter in listeners.iteritems(): if profile is None or not profiles_filter or profile in profiles_filter: - listener(*args) + listener(*args, **kwargs) def check_profile(self, profile): """Tell if the profile is currently followed by the application""" diff -r 139263ee85c5 -r 18cd46a264e9 frontends/src/quick_frontend/quick_contact_list.py --- a/frontends/src/quick_frontend/quick_contact_list.py Tue Feb 24 14:40:19 2015 +0100 +++ b/frontends/src/quick_frontend/quick_contact_list.py Tue Feb 24 16:52:44 2015 +0100 @@ -73,7 +73,7 @@ self.host.bridge.asyncGetParamA(C.SHOW_OFFLINE_CONTACTS, "General", profile_key=profile, callback=self._showOfflineContacts) # FIXME: workaround for a pyjamas issue: calling hash on a class method always return a different value if that method is defined directly within the class (with the "def" keyword) - self.presenceListener = self.updatePresence + self.presenceListener = self.onPresenceUpdate self.host.addListener('presence', self.presenceListener, [profile]) def __contains__(self, entity): @@ -367,13 +367,14 @@ set_.difference_update(to_remove) self.update() - def updatePresence(self, entity, show, priority, statuses): + def onPresenceUpdate(self, entity, show, priority, statuses, profile): """Update entity's presence status - @param entity(jid.JID): entity to update's entity + @param entity(jid.JID): entity updated @param show: availability @parap priority: resource's priority @param statuses: dict of statuses + @param profile: %(doc_profile)s """ cache = self.getCache(entity) if show == C.PRESENCE_UNAVAILABLE: