Primitivus: sexy nick in chat window

This commit is contained in:
Goffi 2010-07-12 18:54:55 +08:00
commit 12b166ca89

View file

@ -66,7 +66,8 @@ class ChatText(urwid.FlowWidget):
if self.parent.show_short_nick:
render_txt.append(('my_nick' if my_mess else 'other_nick',"**" if my_mess else "*"))
else:
render_txt.append(('my_nick' if my_mess else 'other_nick',"[%s] " % self.from_jid))
nick = self.from_jid.resource if self.parent.type == "group" else (self.parent.host.CM.getAttr(self.from_jid,'nick') or self.parent.host.CM.getAttr(self.from_jid,'name') or self.from_jid.node)
render_txt.append(('my_nick' if my_mess else 'other_nick',"[%s] " % nick))
render_txt.append(self.message)
return urwid.Text(render_txt, align=self.align)