# HG changeset patch # User Goffi # Date 1270108677 -39600 # Node ID 9681f18d06bdad9bb1c094b621f2d4dc0697ca2a # Parent db0a0f000e377ffd218c118efdb1ca51e4855175 wix: basic dialog to join MUC room, jid node is now displayed in conversations instead of full jid diff -r db0a0f000e37 -r 9681f18d06bd frontends/wix/chat.py --- a/frontends/wix/chat.py Wed Mar 31 19:56:43 2010 +1100 +++ b/frontends/wix/chat.py Thu Apr 01 18:57:57 2010 +1100 @@ -178,7 +178,7 @@ """Print the message with differents colors depending on where it comes from.""" jid=JID(from_jid) print "printMessage, jid=",jid,"type=",self.type - nick = jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid) + nick = jid.resource if self.type == "group" else (self.host.CM.getAttr(jid,'nick') or self.host.CM.getAttr(jid,'name') or jid.node) 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 _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)) diff -r db0a0f000e37 -r 9681f18d06bd frontends/wix/main_window.py --- a/frontends/wix/main_window.py Wed Mar 31 19:56:43 2010 +1100 +++ b/frontends/wix/main_window.py Thu Apr 01 18:57:57 2010 +1100 @@ -400,7 +400,17 @@ def onJoinRoom(self, e): warning('FIXME: temporary menu, must be improved') - self.bridge.joinMUC("conference.necton2.int", "test", "Goffi \o/", self.profile) + #TODO: a proper MUC room joining dialog with nickname etc + dlg = wx.TextEntryDialog( + self, _("Please enter MUC's JID"), + _('Entering a MUC room'), _('test@conference.necton2.int')) + #_('Entering a MUC room'), _('room@muc_service.server.tld')) + if dlg.ShowModal() == wx.ID_OK: + room_jid=JID(dlg.GetValue()) + if room_jid.is_valid(): + self.bridge.joinMUC(room_jid.domain, room_jid.node, self.profiles[self.profile]['whoami'].node, self.profile) + else: + error (_("'%s' is an invalid JID !"), room_jid) def onFindGateways(self, e): debug(_("Find Gateways request"))