comparison frontends/src/quick_frontend/quick_chat.py @ 501:e9634d2e7b38

core, quick_frontend, primitivus, wix: Contacts List refactoring phase 1: - QuickContactManagement is not used anymore and will be removed, ContactList + Core are used instead - disconnected contacts are now displayed in Primitivus (M-d to show/hide them) - avatars are temporary unavailable in wix - new bridge method: getContactsFromGroup
author Goffi <goffi@goffi.org>
date Tue, 25 Sep 2012 00:58:34 +0200
parents 2a072735e459
children f98bef71a918
comparison
equal deleted inserted replaced
500:00d3679976ab 501:e9634d2e7b38
97 97
98 self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.target.short, 20, callback=onHistory, errback=onHistoryError) 98 self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.target.short, 20, callback=onHistory, errback=onHistoryError)
99 99
100 def _get_nick(self, jid): 100 def _get_nick(self, jid):
101 """Return nick of this jid when possible""" 101 """Return nick of this jid when possible"""
102 return jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid.node) 102 return jid.resource if self.type == "group" else (self.host.contact_list.getCache(jid,'nick') or self.host.contact_list.getCache(jid,'name') or jid.node)
103 103
104 def printMessage(self, from_jid, msg, profile, timestamp): 104 def printMessage(self, from_jid, msg, profile, timestamp):
105 """Print message in chat window. Must be implemented by child class""" 105 """Print message in chat window. Must be implemented by child class"""
106 jid=JID(from_jid) 106 jid=JID(from_jid)
107 nick = self._get_nick(jid) 107 nick = self._get_nick(jid)