summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-01 21:32:44 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-07-01 21:32:44 +0000
commit33c291c9a945da009ab6849855dc3c66ecc103fa (patch)
treee2381d3dd80c4487d58e454a1d3c3e6685683367 /src/gui.py
parent450c234cd3c21032fe7dd10f754fbda0855ef2ac (diff)
downloadpoezio-33c291c9a945da009ab6849855dc3c66ecc103fa.tar.gz
poezio-33c291c9a945da009ab6849855dc3c66ecc103fa.tar.bz2
poezio-33c291c9a945da009ab6849855dc3c66ecc103fa.tar.xz
poezio-33c291c9a945da009ab6849855dc3c66ecc103fa.zip
server on /join can be omitted, fixed #1525 Also reorganize various functions in common.py and update CHANGELOG
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui.py b/src/gui.py
index cb1e7fc2..e7fd8ea8 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -38,7 +38,7 @@ from user import User
from room import Room
from message import Message
-from connection import is_jid_the_same
+from common import is_jid_the_same, jid_get_domain, is_jid
def doupdate():
curses.doupdate()
@@ -600,13 +600,18 @@ class Gui(object):
nick = r.own_nick
else:
room = info[0]
- # if len(room.split('@')) == 1: # no server is provided, like "/join hello"
- # serv = self.current_room().name.split('/')[0]
- # room += '@' + self.current_room.
+ if not is_jid(room): # 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 is_jid(self.current_room().name):
+ room += '@%s' % jid_get_domain(self.current_room().name)
+ 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"))
+ return
r = self.get_room_by_name(room)
if len(args) == 2: # a password is provided
password = args[1]
- if r and r.joined: # if we are already in the room
+ if r and r.joined: # if we are already in the room
self.information(_("already in room [%s]") % room)
return
self.muc.join_room(room, nick, password)