No argument room cmd w/o file go to default room

Currently using the room command without arguments will cause an error
if no file has been opened. This will make it go to the default room
(i.e. the room you joined when you first connected).
This commit is contained in:
Et0h 2012-10-04 02:53:29 +01:00
parent aca685ba18
commit 523dda8e1d
2 changed files with 5 additions and 1 deletions

View File

@ -217,6 +217,7 @@ class SyncplayClientManager(object):
if(room == None or room == ''):
room = 'default'
self.users.currentUser.room = room
self.defaultRoom = room
if(password):
password = hashlib.md5(password).hexdigest()
self.serverPassword = password

View File

@ -72,7 +72,10 @@ class ConsoleUI(threading.Thread):
elif matched_room:
room = matched_room.group(2)
if room == None:
room = self._syncplayClient.users.currentUser.filename
if self._syncplayClient.users.currentUser.filename <> None:
room = self._syncplayClient.users.currentUser.filename
else:
room = self._syncplayClient.defaultRoom
self._syncplayClient.users.currentUser.room = room
self._syncplayClient.checkIfFileMatchesOthers()
self._syncplayClient.protocol.sender.send_room(room)