comparison frontends/src/quick_frontend/quick_app.py @ 1361:d3e9848b9574 frontends_multi_profiles

quick_frontend, primitivus (chat): pass a sorted list to Chat.setPresents
author souliane <souliane@mailoo.org>
date Wed, 11 Mar 2015 20:06:13 +0100
parents 8ea8fa13c351
children fa77e40eb17b
comparison
equal deleted inserted replaced
1360:8ea8fa13c351 1361:d3e9848b9574
522 """Called when a MUC room is joined""" 522 """Called when a MUC room is joined"""
523 log.debug("Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks}) 523 log.debug("Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks})
524 room_jid = jid.JID(room_jid_s) 524 room_jid = jid.JID(room_jid_s)
525 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile) 525 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile)
526 chat_widget.setUserNick(user_nick) 526 chat_widget.setUserNick(user_nick)
527 chat_widget.id = room_jid # FIXME: to be removed 527 chat_widget.id = room_jid # FIXME: to be removed
528 chat_widget.setPresents(list(set([user_nick] + room_nicks))) 528 room_nicks = [unicode(nick) for nick in room_nicks] # FIXME: should be done in DBus bridge / is that still needed?!
529 nicks = list(set([user_nick] + room_nicks))
530 nicks.sort()
531 chat_widget.setPresents(nicks)
529 self.contact_lists[profile].setSpecial(room_jid, C.CONTACT_SPECIAL_GROUP) 532 self.contact_lists[profile].setSpecial(room_jid, C.CONTACT_SPECIAL_GROUP)
530 533
531 def roomLeftHandler(self, room_jid_s, profile): 534 def roomLeftHandler(self, room_jid_s, profile):
532 """Called when a MUC room is left""" 535 """Called when a MUC room is left"""
533 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile}) 536 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile})