comparison frontends/wix/chat.py @ 80:9681f18d06bd

wix: basic dialog to join MUC room, jid node is now displayed in conversations instead of full jid
author Goffi <goffi@goffi.org>
date Thu, 01 Apr 2010 18:57:57 +1100
parents db0a0f000e37
children fc7583282d40
comparison
equal deleted inserted replaced
79:db0a0f000e37 80:9681f18d06bd
176 176
177 def printMessage(self, from_jid, msg, profile, timestamp=""): 177 def printMessage(self, from_jid, msg, profile, timestamp=""):
178 """Print the message with differents colors depending on where it comes from.""" 178 """Print the message with differents colors depending on where it comes from."""
179 jid=JID(from_jid) 179 jid=JID(from_jid)
180 print "printMessage, jid=",jid,"type=",self.type 180 print "printMessage, jid=",jid,"type=",self.type
181 nick = jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid) 181 nick = jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid.node)
182 mymess = (jid.resource == self.nick) if self.type == "group" else (jid.short == self.host.profiles[profile]['whoami'].short) #mymess = True if message comes from local user 182 mymess = (jid.resource == self.nick) if self.type == "group" else (jid.short == self.host.profiles[profile]['whoami'].short) #mymess = True if message comes from local user
183 _font = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD) 183 _font = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD)
184 self.chatWindow.SetDefaultStyle(wx.TextAttr( "BLACK" if mymess else "BLUE", font=_font)) 184 self.chatWindow.SetDefaultStyle(wx.TextAttr( "BLACK" if mymess else "BLUE", font=_font))
185 self.chatWindow.AppendText("[%s] " % nick) 185 self.chatWindow.AppendText("[%s] " % nick)
186 _font = wx.Font(self.font["points"], self.font["family"], wx.ITALIC if mymess else wx.NORMAL, wx.NORMAL) 186 _font = wx.Font(self.font["points"], self.font["family"], wx.ITALIC if mymess else wx.NORMAL, wx.NORMAL)