From 523dda8e1ddc682dbda7d325e2a727db9ce19412 Mon Sep 17 00:00:00 2001 From: Et0h Date: Thu, 4 Oct 2012 02:53:29 +0100 Subject: [PATCH] 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). --- syncplay/client.py | 1 + syncplay/ui/consoleUI.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/syncplay/client.py b/syncplay/client.py index 46794da..96d2be7 100644 --- a/syncplay/client.py +++ b/syncplay/client.py @@ -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 diff --git a/syncplay/ui/consoleUI.py b/syncplay/ui/consoleUI.py index 5f8afae..9e915a3 100644 --- a/syncplay/ui/consoleUI.py +++ b/syncplay/ui/consoleUI.py @@ -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)