diff options
author | mathieui <mathieui@mathieui.net> | 2013-06-05 20:44:27 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-06-05 20:44:27 +0200 |
commit | 9e8860cd6abae3c41af085fc940853653f1ee9d6 (patch) | |
tree | 1dc16c6fe59860bc8473aa4fe66442ce861d7709 /src | |
parent | ae009318b2faa4b5f043b6f87353de7123a43409 (diff) | |
download | poezio-9e8860cd6abae3c41af085fc940853653f1ee9d6.tar.gz poezio-9e8860cd6abae3c41af085fc940853653f1ee9d6.tar.bz2 poezio-9e8860cd6abae3c41af085fc940853653f1ee9d6.tar.xz poezio-9e8860cd6abae3c41af085fc940853653f1ee9d6.zip |
Fix joining a domain-only room
(e.g. “/join @conference.prosody.im”)
- If the current tab is a MUC the @ prefix is mandatory as there is no
way to tell if the user meant a room name or a domain.
- If it is not a MUC, then the @ prefix is not mandatory (but works
anyway)
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/core.py b/src/core.py index 40661e89..a77868cb 100644 --- a/src/core.py +++ b/src/core.py @@ -1684,7 +1684,12 @@ class Core(object): room = safeJID(tab.get_name()).bare nick = tab.own_nick else: - info = safeJID(args[0]) + if args[0].startswith('@'): # we try to join a server directly + server_root = True + info = safeJID(args[0][1:]) + else: + info = safeJID(args[0]) + server_root = False if info == '' and len(args[0]) > 1 and args[0][0] == '/': nick = args[0][1:] elif info.resource == '': @@ -1703,15 +1708,14 @@ class Core(object): nick = tab.own_nick else: room = info.bare - if room.find('@') == -1: # no server is provided, like "/join hello" + 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: # no server could be found, print a message and return - self.information(_("You didn't specify a server for the room you want to join"), 'Error') - return + else: + room = args[0] room = room.lower() if room in self.pending_invites: del self.pending_invites[room] |