summaryrefslogtreecommitdiff
path: root/src/gui.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-30 02:50:24 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-01-30 02:50:24 +0000
commit95c7ad4ac82762e3e017cd8ef85d267add803126 (patch)
treee98d55b51030718874810c5e70f08b5dbfc2559d /src/gui.py
parent33cf82e0947be35bf4e4666d0db632b60e5c27f9 (diff)
downloadpoezio-95c7ad4ac82762e3e017cd8ef85d267add803126.tar.gz
poezio-95c7ad4ac82762e3e017cd8ef85d267add803126.tar.bz2
poezio-95c7ad4ac82762e3e017cd8ef85d267add803126.tar.xz
poezio-95c7ad4ac82762e3e017cd8ef85d267add803126.zip
on peut choisir son nick lors d'un /join machin@truc/NICK
Diffstat (limited to 'src/gui.py')
-rw-r--r--src/gui.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui.py b/src/gui.py
index ddcd57d6..f749261a 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -28,6 +28,8 @@ from logging import logger
from random import randrange
+from config import config
+
locale.setlocale(locale.LC_ALL, '')
code = locale.getpreferredencoding()
@@ -292,6 +294,7 @@ class Gui(object):
def execute(self):
line = self.window.input.get_text()
self.window.input.clear_text()
+ curses.doupdate()
if line == "":
return
if line.startswith('/'):
@@ -306,13 +309,19 @@ class Gui(object):
self.window.input.refresh()
def command_join(self, args):
- room = args[0]
+ info = args[0].split('/')
+ if len(info) == 1:
+ nick = config.get('default_nick', 'Poezio')
+ else:
+ nick = info[1]
+ room = info[0]
r = self.get_room_by_name(room)
- if r: # 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, "poezio")
- self.join_room(room, 'poezio')
+ self.muc.join_room(room, nick)
+ if not r: # if the room window exist, we don't recreate it.
+ self.join_room(room, nick)
def information(self, msg):
room = self.get_room_by_name("Info")