Mercurial > libervia-backend
comparison frontends/src/quick_frontend/quick_app.py @ 1481:621b045cd284
QuickFrontend: removed old watched stuff as a new plugin now manages it properly
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 20 Aug 2015 18:44:39 +0200 |
parents | 731fbed0b9cf |
children | 039d96e131be |
comparison
equal
deleted
inserted
replaced
1480:8d61160ee4b8 | 1481:621b045cd284 |
---|---|
84 def _plug_profile_failedCachedValues(self, failure): | 84 def _plug_profile_failedCachedValues(self, failure): |
85 log.error(u"Couldn't get cached values: {}".format(failure)) | 85 log.error(u"Couldn't get cached values: {}".format(failure)) |
86 self._plug_profile_gotCachedValues({}) | 86 self._plug_profile_gotCachedValues({}) |
87 | 87 |
88 def _plug_profile_gotCachedValues(self, cached_values): | 88 def _plug_profile_gotCachedValues(self, cached_values): |
89 # TODO: watched plugin | |
90 | |
91 # add the contact list and its listener | 89 # add the contact list and its listener |
92 contact_list = self.host.addContactList(self.profile) | 90 contact_list = self.host.addContactList(self.profile) |
93 self.host.contact_lists[self.profile] = contact_list | 91 self.host.contact_lists[self.profile] = contact_list |
94 | 92 |
95 for entity, data in cached_values.iteritems(): | 93 for entity, data in cached_values.iteritems(): |
539 # FIXME: try to retrieve user language status before fallback to default | 537 # FIXME: try to retrieve user language status before fallback to default |
540 status = statuses.get(C.PRESENCE_STATUSES_DEFAULT, None) | 538 status = statuses.get(C.PRESENCE_STATUSES_DEFAULT, None) |
541 self.setPresenceStatus(show, status, profile=profile) | 539 self.setPresenceStatus(show, status, profile=profile) |
542 return | 540 return |
543 | 541 |
544 # #FIXME: must be moved in a plugin | |
545 # if entity.bare in self.profiles[profile].data.get('watched',[]) and not entity.bare in self.profiles[profile]['onlineContact']: | |
546 # self.showAlert(_("Watched jid [%s] is connected !") % entity.bare) | |
547 | |
548 self.callListeners('presence', entity, show, priority, statuses, profile=profile) | 542 self.callListeners('presence', entity, show, priority, statuses, profile=profile) |
549 | 543 |
550 def roomJoinedHandler(self, room_jid_s, room_nicks, user_nick, profile): | 544 def roomJoinedHandler(self, room_jid_s, room_nicks, user_nick, profile): |
551 """Called when a MUC room is joined""" | 545 """Called when a MUC room is joined""" |
552 log.debug(u"Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks}) | 546 log.debug(u"Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks}) |
690 def paramUpdateHandler(self, name, value, namespace, profile): | 684 def paramUpdateHandler(self, name, value, namespace, profile): |
691 log.debug(_(u"param update: [%(namespace)s] %(name)s = %(value)s") % {'namespace': namespace, 'name': name, 'value': value}) | 685 log.debug(_(u"param update: [%(namespace)s] %(name)s = %(value)s") % {'namespace': namespace, 'name': name, 'value': value}) |
692 if (namespace, name) == ("Connection", "JabberID"): | 686 if (namespace, name) == ("Connection", "JabberID"): |
693 log.debug(_(u"Changing JID to %s") % value) | 687 log.debug(_(u"Changing JID to %s") % value) |
694 self.profiles[profile].whoami = jid.JID(value) | 688 self.profiles[profile].whoami = jid.JID(value) |
695 elif (namespace, name) == ("Misc", "Watched"): | |
696 self.profiles[profile]['watched'] = value.split() | |
697 elif (namespace, name) == ('General', C.SHOW_OFFLINE_CONTACTS): | 689 elif (namespace, name) == ('General', C.SHOW_OFFLINE_CONTACTS): |
698 self.contact_lists[profile].showOfflineContacts(C.bool(value)) | 690 self.contact_lists[profile].showOfflineContacts(C.bool(value)) |
699 elif (namespace, name) == ('General', C.SHOW_EMPTY_GROUPS): | 691 elif (namespace, name) == ('General', C.SHOW_EMPTY_GROUPS): |
700 self.contact_lists[profile].showEmptyGroups(C.bool(value)) | 692 self.contact_lists[profile].showEmptyGroups(C.bool(value)) |
701 | 693 |