wix: basic dialog to join MUC room, jid node is now displayed in conversations instead of full jid

This commit is contained in:
Goffi 2010-04-01 18:57:57 +11:00
commit d85645945b
2 changed files with 12 additions and 2 deletions

View file

@ -178,7 +178,7 @@ class Chat(wx.Frame, QuickChat):
"""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))

View file

@ -400,7 +400,17 @@ class MainWindow(wx.Frame, QuickApp):
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"))