mirror of
https://github.com/Syncplay/syncplay
synced 2025-01-12 09:49:44 +00:00
Improvements in userlist handling
This commit is contained in:
parent
957f5498a4
commit
e5dc3135aa
@ -396,7 +396,7 @@ class SyncplayUserlist(object):
|
|||||||
|
|
||||||
def __addDifferentFileMessageIfNecessary(self, user, message):
|
def __addDifferentFileMessageIfNecessary(self, user, message):
|
||||||
if(self.currentUser.file):
|
if(self.currentUser.file):
|
||||||
fileHasSameSizeAsYour = user.file['size'] != self.currentUser.file['size']
|
fileHasSameSizeAsYour = user.file['size'] == self.currentUser.file['size']
|
||||||
differentFileMessage = " (but their file size is different from yours!)"
|
differentFileMessage = " (but their file size is different from yours!)"
|
||||||
message += differentFileMessage if not fileHasSameSizeAsYour else ""
|
message += differentFileMessage if not fileHasSameSizeAsYour else ""
|
||||||
return message
|
return message
|
||||||
@ -427,6 +427,9 @@ class SyncplayUserlist(object):
|
|||||||
self.__createListOfPeople(rooms)
|
self.__createListOfPeople(rooms)
|
||||||
self.__displayListOfPeople(rooms)
|
self.__displayListOfPeople(rooms)
|
||||||
|
|
||||||
|
def clearList(self):
|
||||||
|
self._users = {}
|
||||||
|
|
||||||
class UiManager(object):
|
class UiManager(object):
|
||||||
def __init__(self, client, ui):
|
def __init__(self, client, ui):
|
||||||
self._client = client
|
self._client = client
|
||||||
|
@ -89,6 +89,7 @@ class SyncClientProtocol(JSONCommandProtocol):
|
|||||||
self._client.setRoom(roomName)
|
self._client.setRoom(roomName)
|
||||||
self.logged = True
|
self.logged = True
|
||||||
self._client.sendFile()
|
self._client.sendFile()
|
||||||
|
self.sendList()
|
||||||
|
|
||||||
def sendHello(self):
|
def sendHello(self):
|
||||||
hello = {}
|
hello = {}
|
||||||
@ -136,6 +137,7 @@ class SyncClientProtocol(JSONCommandProtocol):
|
|||||||
self.sendSet({"file": file_})
|
self.sendSet({"file": file_})
|
||||||
|
|
||||||
def handleList(self, userList):
|
def handleList(self, userList):
|
||||||
|
self._client.userlist.clearList()
|
||||||
for room in userList.iteritems():
|
for room in userList.iteritems():
|
||||||
roomName = room[0]
|
roomName = room[0]
|
||||||
for user in room[1].iteritems():
|
for user in room[1].iteritems():
|
||||||
@ -274,7 +276,6 @@ class SyncServerProtocol(JSONCommandProtocol):
|
|||||||
self._factory.addWatcher(self, username, roomName, roomPassword)
|
self._factory.addWatcher(self, username, roomName, roomPassword)
|
||||||
self._logged = True
|
self._logged = True
|
||||||
self.sendHello()
|
self.sendHello()
|
||||||
self.sendList()
|
|
||||||
|
|
||||||
def sendHello(self):
|
def sendHello(self):
|
||||||
hello = {}
|
hello = {}
|
||||||
|
Loading…
Reference in New Issue
Block a user