Permalink
Browse files

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).
  • Loading branch information...
1 parent aca685b commit 523dda8e1ddc682dbda7d325e2a727db9ce19412 @Et0h committed Oct 4, 2012
Showing with 5 additions and 1 deletion.
  1. +1 −0 syncplay/client.py
  2. +4 −1 syncplay/ui/consoleUI.py
View
1 syncplay/client.py
@@ -217,6 +217,7 @@ def __init__(self, name, make_player, ui, debug, room, password = None):
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
5 syncplay/ui/consoleUI.py
@@ -72,7 +72,10 @@ def _executeCommand(self, data):
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)

0 comments on commit 523dda8

Please sign in to comment.