From cbcac03510de5c316bc5e5c0136547911beeacd2 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 29 Jul 2013 19:31:33 +0200 Subject: Fix #2335 (crash on /cycle with room without userpart) --- src/core.py | 16 ++++++++-------- src/multiuserchat.py | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/core.py b/src/core.py index d1b0d7e5..009cfaa4 100644 --- a/src/core.py +++ b/src/core.py @@ -1811,14 +1811,14 @@ class Core(object): nick = tab.own_nick else: room = info.bare - if room.find('@') == -1 and not server_root: # no server is provided, like "/join hello" - # use the server of the current room if available - # check if the current room's name has a server - if isinstance(self.current_tab(), tabs.MucTab) and\ - self.current_tab().get_name().find('@') != -1: - room += '@%s' % safeJID(self.current_tab().get_name()).domain - else: - room = args[0] + if room.find('@') == -1 and not server_root: # no server is provided, like "/join hello" + # use the server of the current room if available + # check if the current room's name has a server + if isinstance(self.current_tab(), tabs.MucTab) and\ + self.current_tab().get_name().find('@') != -1: + room += '@%s' % safeJID(self.current_tab().get_name()).domain + else: + room = args[0] room = room.lower() if room in self.pending_invites: del self.pending_invites[room] diff --git a/src/multiuserchat.py b/src/multiuserchat.py index 013fd2cb..d69daf42 100644 --- a/src/multiuserchat.py +++ b/src/multiuserchat.py @@ -66,8 +66,7 @@ def change_nick(core, jid, nick, status=None, show=None): def join_groupchat(core, jid, nick, passwd='', maxhistory=None, status=None, show=None, seconds=0): xmpp = core.xmpp - jid = safeJID(jid) - stanza = xmpp.makePresence(pto="%s/%s" % (jid, nick), pstatus=status, pshow=show) + stanza = xmpp.makePresence(pto='%s/%s' % (jid, nick), pstatus=status, pshow=show) x = ET.Element('{http://jabber.org/protocol/muc}x') if passwd: passelement = ET.Element('password') -- cgit v1.2.3