comparison frontends/src/quick_frontend/quick_app.py @ 1386:1f3513cfb246

quick_frontend, primivitus: remove QuickChat.getUserNick + primivitus ChatText gets the user nick directly from parent Chat instance
author souliane <souliane@mailoo.org>
date Mon, 23 Mar 2015 15:38:32 +0100
parents b01efa1c0f5e
children a025242bebe7
comparison
equal deleted inserted replaced
1385:0dca4f9b264d 1386:1f3513cfb246
530 def roomJoinedHandler(self, room_jid_s, room_nicks, user_nick, profile): 530 def roomJoinedHandler(self, room_jid_s, room_nicks, user_nick, profile):
531 """Called when a MUC room is joined""" 531 """Called when a MUC room is joined"""
532 log.debug("Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks}) 532 log.debug("Room [%(room_jid)s] joined by %(profile)s, users presents:%(users)s" % {'room_jid': room_jid_s, 'profile': profile, 'users': room_nicks})
533 room_jid = jid.JID(room_jid_s) 533 room_jid = jid.JID(room_jid_s)
534 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile) 534 chat_widget = self.widgets.getOrCreateWidget(quick_chat.QuickChat, room_jid, type_=C.CHAT_GROUP, profile=profile)
535 chat_widget.setUserNick(user_nick) 535 chat_widget.setUserNick(unicode(user_nick))
536 self.contact_lists[profile].setSpecial(room_jid, C.CONTACT_SPECIAL_GROUP) 536 self.contact_lists[profile].setSpecial(room_jid, C.CONTACT_SPECIAL_GROUP)
537 537
538 def roomLeftHandler(self, room_jid_s, profile): 538 def roomLeftHandler(self, room_jid_s, profile):
539 """Called when a MUC room is left""" 539 """Called when a MUC room is left"""
540 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile}) 540 log.debug("Room [%(room_jid)s] left by %(profile)s" % {'room_jid': room_jid_s, 'profile': profile})
640 target = jid.JID(jid_s) 640 target = jid.JID(jid_s)
641 self.contact_lists[profile].remove(target) 641 self.contact_lists[profile].remove(target)
642 642
643 def entityDataUpdatedHandler(self, entity_s, key, value, profile): 643 def entityDataUpdatedHandler(self, entity_s, key, value, profile):
644 entity = jid.JID(entity_s) 644 entity = jid.JID(entity_s)
645 if key == "nick": 645 if key == "nick": # this is the roster nick, not the MUC nick
646 if entity in self.contact_lists[profile]: 646 if entity in self.contact_lists[profile]:
647 self.contact_lists[profile].setCache(entity, 'nick', value) 647 self.contact_lists[profile].setCache(entity, 'nick', value)
648 self.callListeners('nick', entity, value, profile=profile) 648 self.callListeners('nick', entity, value, profile=profile)
649 elif key == "avatar": 649 elif key == "avatar":
650 if entity in self.contact_lists[profile]: 650 if entity in self.contact_lists[profile]: