fix some stuff (/query, /help args, etc)

parent 9ad62d44
...@@ -408,8 +408,7 @@ class Gui(object): ...@@ -408,8 +408,7 @@ class Gui(object):
self.rooms.insert(self.rooms.index(ro), r) self.rooms.insert(self.rooms.index(ro), r)
break break
if focus: # focus the room if needed if focus: # focus the room if needed
while self.current_room().nb != r.nb: self.command_win('%s' % (r.nb))
self.rooms.insert(0, self.rooms.pop())
# self.window.new_room(r) # self.window.new_room(r)
self.refresh_window() self.refresh_window()
return r return r
...@@ -675,12 +674,12 @@ class Gui(object): ...@@ -675,12 +674,12 @@ class Gui(object):
""" """
args = arg.split() args = arg.split()
if len(args) != 1: if len(args) != 1:
self.command_help(['win']) self.command_help('win')
return return
try: try:
nb = int(args[0]) nb = int(args[0])
except ValueError: except ValueError:
self.command_help(['win']) self.command_help('win')
return return
if self.current_room().nb == nb: if self.current_room().nb == nb:
return return
...@@ -703,7 +702,7 @@ class Gui(object): ...@@ -703,7 +702,7 @@ class Gui(object):
""" """
args = arg.split() args = arg.split()
if len(args) < 1: if len(args) < 1:
self.command_help(['kick']) self.command_help('kick')
return return
nick = args[0] nick = args[0]
if len(args) >= 2: if len(args) >= 2:
...@@ -824,7 +823,7 @@ class Gui(object): ...@@ -824,7 +823,7 @@ class Gui(object):
""" """
args = arg.split() args = arg.split()
if len(args) != 2 and len(args) != 1: if len(args) != 2 and len(args) != 1:
self.command_help(['set']) self.command_help('set')
return return
option = args[0] option = args[0]
if len(args) == 2: if len(args) == 2:
...@@ -855,7 +854,7 @@ class Gui(object): ...@@ -855,7 +854,7 @@ class Gui(object):
if len(args) < 1: if len(args) < 1:
return return
if not args[0] in possible_show.keys(): if not args[0] in possible_show.keys():
self.command_help(['show']) self.command_help('show')
return return
show = possible_show[args[0]] show = possible_show[args[0]]
if len(args) > 1: if len(args) > 1:
...@@ -872,7 +871,7 @@ class Gui(object): ...@@ -872,7 +871,7 @@ class Gui(object):
""" """
args = arg.split() args = arg.split()
if len(args) != 1: if len(args) != 1:
self.command_help(['ignore']) self.command_help('ignore')
return return
if self.current_room().name == 'Info' or not self.current_room().joined: if self.current_room().name == 'Info' or not self.current_room().joined:
return return
...@@ -892,7 +891,7 @@ class Gui(object): ...@@ -892,7 +891,7 @@ class Gui(object):
""" """
args = arg.split() args = arg.split()
if len(args) != 1: if len(args) != 1:
self.command_help(['unignore']) self.command_help('unignore')
return return
if self.current_room().name == 'Info' or not self.current_room().joined: if self.current_room().name == 'Info' or not self.current_room().joined:
return return
...@@ -965,8 +964,8 @@ class Gui(object): ...@@ -965,8 +964,8 @@ class Gui(object):
for user in room.users: for user in room.users:
if user.nick == nick: if user.nick == nick:
r = self.open_private_window(room.name, user.nick) r = self.open_private_window(room.name, user.nick)
if room and len(args) > 1: if r and len(args) > 1:
msg = ' '.join(args[1:]) msg = arg[len(nick)+1:]
self.muc.send_private_message(r.name, msg) self.muc.send_private_message(r.name, msg)
self.add_message_to_room(r, msg.decode('utf-8'), None, r.own_nick) self.add_message_to_room(r, msg.decode('utf-8'), None, r.own_nick)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment