# HG changeset patch # User Goffi # Date 1269925724 -39600 # Node ID 1ae680f9682efc2519e2ea7a55f409ea9758bb3e # Parent 8becde8a967c40624f6433a0226cf4e931833303 wix: MUC groupchat management + short nick shown in chat window instead of full jid when possible diff -r 8becde8a967c -r 1ae680f9682e frontends/wix/chat.py --- a/frontends/wix/chat.py Tue Mar 30 13:15:05 2010 +1100 +++ b/frontends/wix/chat.py Tue Mar 30 16:08:44 2010 +1100 @@ -153,7 +153,10 @@ def onEnterPressed(self, event): """Behaviour when enter pressed in send line.""" - self.host.bridge.sendMessage(self.target, event.GetString(), profile_key=self.host.profile) + self.host.bridge.sendMessage(self.target.short if self.type=='group' else self.target, + event.GetString(), + type = "groupchat" if self.type=='group' else "chat", + profile_key=self.host.profile) self.textBox.Clear() @@ -161,10 +164,11 @@ def printMessage(self, from_jid, msg, profile, timestamp=""): """Print the message with differents colors depending on where it comes from.""" jid=JID(from_jid) + nick = jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid) mymess = (jid.short == self.host.profiles[profile]['whoami'].short) #mymess = True if message comes from local user _font = wx.Font(self.font["points"], self.font["family"], wx.NORMAL, wx.BOLD) self.chatWindow.SetDefaultStyle(wx.TextAttr( "BLACK" if mymess else "BLUE", font=_font)) - self.chatWindow.AppendText("[%s] " % jid) + self.chatWindow.AppendText("[%s] " % nick) _font = wx.Font(self.font["points"], self.font["family"], wx.ITALIC if mymess else wx.NORMAL, wx.NORMAL) self.chatWindow.SetDefaultStyle(wx.TextAttr("BLACK", font=_font)) self.chatWindow.AppendText("%s\n" % msg) diff -r 8becde8a967c -r 1ae680f9682e plugins/plugin_xep_0045.py --- a/plugins/plugin_xep_0045.py Tue Mar 30 13:15:05 2010 +1100 +++ b/plugins/plugin_xep_0045.py Tue Mar 30 16:08:44 2010 +1100 @@ -139,6 +139,10 @@ user_data={'entity':user.entity or '', 'affiliation':user.affiliation, 'role':user.role} self.host.bridge.roomUserLeft(room.roomIdentifier, room.service, user.nick, user_data, self.parent.profile) + def userUpdatedStatus(self, room, user, show, status): + print("FIXME: MUC status not managed yet") + #FIXME: gof + def receivedSubject(self, room, subject): debug (_("New subject for room (%(room_id)s): %(subject)s") % {'room_id':room.occupantJID.userhost(),'subject':subject}) self.host.bridge.roomNewSubject(room.roomIdentifier, room.service, subject, self.parent.profile)