comparison frontends/src/quick_frontend/quick_app.py @ 1397:96dd0ae1a850

quick_frontend (contact_list): rename QuickContactList.remove to QuickContactList.removeContact + remove the contact from _roster attribute (and not only from _cache)
author souliane <souliane@mailoo.org>
date Wed, 01 Apr 2015 22:07:28 +0200
parents 069ad98b360d
children 3265a2639182
comparison
equal deleted inserted replaced
1396:069ad98b360d 1397:96dd0ae1a850
541 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile}) 541 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile})
542 room_jid = jid.JID(room_jid_s) 542 room_jid = jid.JID(room_jid_s)
543 chat_widget = self.widgets.getWidget(quick_chat.QuickChat, room_jid, profile) 543 chat_widget = self.widgets.getWidget(quick_chat.QuickChat, room_jid, profile)
544 if chat_widget: 544 if chat_widget:
545 self.widgets.deleteWidget(chat_widget) 545 self.widgets.deleteWidget(chat_widget)
546 self.contact_lists[profile].remove(room_jid) 546 self.contact_lists[profile].removeContact(room_jid)
547 547
548 def roomUserJoinedHandler(self, room_jid_s, user_nick, user_data, profile): 548 def roomUserJoinedHandler(self, room_jid_s, user_nick, user_data, profile):
549 """Called when an user joined a MUC room""" 549 """Called when an user joined a MUC room"""
550 room_jid = jid.JID(room_jid_s) 550 room_jid = jid.JID(room_jid_s)
551 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile) 551 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile)
641 elif (namespace, name) == ('General', C.SHOW_EMPTY_GROUPS): 641 elif (namespace, name) == ('General', C.SHOW_EMPTY_GROUPS):
642 self.contact_lists[profile].showEmptyGroups(C.bool(value)) 642 self.contact_lists[profile].showEmptyGroups(C.bool(value))
643 643
644 def contactDeletedHandler(self, jid_s, profile): 644 def contactDeletedHandler(self, jid_s, profile):
645 target = jid.JID(jid_s) 645 target = jid.JID(jid_s)
646 self.contact_lists[profile].remove(target) 646 self.contact_lists[profile].removeContact(target, in_roster=True)
647 647
648 def entityDataUpdatedHandler(self, entity_s, key, value, profile): 648 def entityDataUpdatedHandler(self, entity_s, key, value, profile):
649 entity = jid.JID(entity_s) 649 entity = jid.JID(entity_s)
650 if key == "nick": # this is the roster nick, not the MUC nick 650 if key == "nick": # this is the roster nick, not the MUC nick
651 if entity in self.contact_lists[profile]: 651 if entity in self.contact_lists[profile]: