Don't wipe password when joining public server (but only send passwords to private servers)

This commit is contained in:
Etoh 2017-10-17 00:24:48 +01:00 committed by alby128
parent cdbc6ac7c7
commit 70e7ff291e
4 changed files with 22 additions and 5 deletions

View File

@ -1,4 +1,4 @@
version = '1.5.0'
milestone = 'Yoitsu'
release_number = '40'
release_number = '41'
projectURL = 'http://syncplay.pl/'

View File

@ -92,6 +92,8 @@ class SyncplayClient(object):
if config['password']:
config['password'] = hashlib.md5(config['password']).hexdigest()
self._serverPassword = config['password']
self._host = u"{}:{}".format(config['host'],config['port'])
self._publicServers = config["publicServers"]
if not config['file']:
self.__getUserlistOnLogon = True
else:
@ -634,7 +636,20 @@ class SyncplayClient(object):
self.userlist.showUserList()
def getPassword(self):
return self._serverPassword
if self.thisIsPublicServer():
return ""
else:
return self._serverPassword
def thisIsPublicServer(self):
self._publicServers = []
if self._publicServers and self._host in self._publicServers:
return True
i = 0
for server in constants.FALLBACK_PUBLIC_SYNCPLAY_SERVERS:
if server[1] == self._host:
return True
i += 1
def setPosition(self, position):
if self._lastPlayerUpdate:

View File

@ -62,7 +62,8 @@ class ConfigurationGetter(object):
"showSameRoomOSD" : True,
"showNonControllerOSD" : False,
"showContactInfo" : True,
"showDurationNotification" : True
"showDurationNotification" : True,
"publicServers" : []
}
self._defaultConfig = self._config.copy()
@ -115,6 +116,7 @@ class ConfigurationGetter(object):
"perPlayerArguments",
"mediaSearchDirectories",
"trustedDomains",
"publicServers",
]
self._numeric = [
@ -137,7 +139,7 @@ class ConfigurationGetter(object):
"autoplayInitialState", "mediaSearchDirectories",
"sharedPlaylistEnabled", "loopAtEndOfPlaylist",
"loopSingleFiles",
"onlySwitchToTrustedDomains", "trustedDomains"],
"onlySwitchToTrustedDomains", "trustedDomains","publicServers"],
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD",
"showDifferentRoomOSD", "showSameRoomOSD",
"showNonControllerOSD", "showDurationNotification"],

View File

@ -396,6 +396,7 @@ class ConfigDialog(QtGui.QDialog):
self.config['file'] = os.path.abspath(self.mediapathTextbox.text())
else:
self.config['file'] = unicode(self.mediapathTextbox.text())
self.config['publicServers'] = self.publicServerAddresses
self.pressedclosebutton = False
self.close()
@ -1053,7 +1054,6 @@ class ConfigDialog(QtGui.QDialog):
if (self.hostCombobox.currentText() == "" and self.serverpassTextbox.text() == "") or unicode(self.hostCombobox.currentText()) in self.publicServerAddresses:
self.serverpassLabel.hide()
self.serverpassTextbox.hide()
self.serverpassTextbox.setText("")
else:
self.serverpassLabel.show()
self.serverpassTextbox.show()