quick_frontends, primitivus: know who are the MUC occupants from the presence informations:

- QuickChat.occupants is now a property using cached information
    - some MUC handlers are no more needed, the presence handler is enough
This commit is contained in:
souliane 2015-03-20 16:25:38 +01:00
commit c6419871ac

View file

@ -534,10 +534,6 @@ class QuickApp(object):
chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile)
chat_widget.setUserNick(user_nick)
chat_widget.id = room_jid # FIXME: to be removed
room_nicks = [unicode(nick) for nick in room_nicks] # FIXME: should be done in DBus bridge / is that still needed?!
nicks = list(set([user_nick] + room_nicks))
nicks.sort()
chat_widget.setPresents(nicks)
self.contact_lists[profile].setSpecial(room_jid, C.CONTACT_SPECIAL_GROUP)
def roomLeftHandler(self, room_jid_s, profile):
@ -553,7 +549,7 @@ class QuickApp(object):
"""Called when an user joined a MUC room"""
room_jid = jid.JID(room_jid_s)
chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile)
chat_widget.replaceUser(user_nick)
chat_widget.addUser(user_nick)
log.debug("user [%(user_nick)s] joined room [%(room_jid)s]" % {'user_nick': user_nick, 'room_jid': room_jid})
def roomUserLeftHandler(self, room_jid_s, user_nick, user_data, profile):