Don't wipe password when joining public server (but only send passwords to private servers)
This commit is contained in:
parent
f5dfd7b996
commit
b34e49c636
@ -1,4 +1,4 @@
|
|||||||
version = '1.5.0'
|
version = '1.5.0'
|
||||||
milestone = 'Yoitsu'
|
milestone = 'Yoitsu'
|
||||||
release_number = '40'
|
release_number = '41'
|
||||||
projectURL = 'http://syncplay.pl/'
|
projectURL = 'http://syncplay.pl/'
|
||||||
|
|||||||
@ -92,6 +92,8 @@ class SyncplayClient(object):
|
|||||||
if config['password']:
|
if config['password']:
|
||||||
config['password'] = hashlib.md5(config['password']).hexdigest()
|
config['password'] = hashlib.md5(config['password']).hexdigest()
|
||||||
self._serverPassword = config['password']
|
self._serverPassword = config['password']
|
||||||
|
self._host = u"{}:{}".format(config['host'],config['port'])
|
||||||
|
self._publicServers = config["publicServers"]
|
||||||
if not config['file']:
|
if not config['file']:
|
||||||
self.__getUserlistOnLogon = True
|
self.__getUserlistOnLogon = True
|
||||||
else:
|
else:
|
||||||
@ -634,7 +636,20 @@ class SyncplayClient(object):
|
|||||||
self.userlist.showUserList()
|
self.userlist.showUserList()
|
||||||
|
|
||||||
def getPassword(self):
|
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):
|
def setPosition(self, position):
|
||||||
if self._lastPlayerUpdate:
|
if self._lastPlayerUpdate:
|
||||||
|
|||||||
@ -62,7 +62,8 @@ class ConfigurationGetter(object):
|
|||||||
"showSameRoomOSD" : True,
|
"showSameRoomOSD" : True,
|
||||||
"showNonControllerOSD" : False,
|
"showNonControllerOSD" : False,
|
||||||
"showContactInfo" : True,
|
"showContactInfo" : True,
|
||||||
"showDurationNotification" : True
|
"showDurationNotification" : True,
|
||||||
|
"publicServers" : []
|
||||||
}
|
}
|
||||||
|
|
||||||
self._defaultConfig = self._config.copy()
|
self._defaultConfig = self._config.copy()
|
||||||
@ -115,6 +116,7 @@ class ConfigurationGetter(object):
|
|||||||
"perPlayerArguments",
|
"perPlayerArguments",
|
||||||
"mediaSearchDirectories",
|
"mediaSearchDirectories",
|
||||||
"trustedDomains",
|
"trustedDomains",
|
||||||
|
"publicServers",
|
||||||
]
|
]
|
||||||
|
|
||||||
self._numeric = [
|
self._numeric = [
|
||||||
@ -137,7 +139,7 @@ class ConfigurationGetter(object):
|
|||||||
"autoplayInitialState", "mediaSearchDirectories",
|
"autoplayInitialState", "mediaSearchDirectories",
|
||||||
"sharedPlaylistEnabled", "loopAtEndOfPlaylist",
|
"sharedPlaylistEnabled", "loopAtEndOfPlaylist",
|
||||||
"loopSingleFiles",
|
"loopSingleFiles",
|
||||||
"onlySwitchToTrustedDomains", "trustedDomains"],
|
"onlySwitchToTrustedDomains", "trustedDomains","publicServers"],
|
||||||
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD",
|
"gui": ["showOSD", "showOSDWarnings", "showSlowdownOSD",
|
||||||
"showDifferentRoomOSD", "showSameRoomOSD",
|
"showDifferentRoomOSD", "showSameRoomOSD",
|
||||||
"showNonControllerOSD", "showDurationNotification"],
|
"showNonControllerOSD", "showDurationNotification"],
|
||||||
|
|||||||
@ -396,6 +396,7 @@ class ConfigDialog(QtGui.QDialog):
|
|||||||
self.config['file'] = os.path.abspath(self.mediapathTextbox.text())
|
self.config['file'] = os.path.abspath(self.mediapathTextbox.text())
|
||||||
else:
|
else:
|
||||||
self.config['file'] = unicode(self.mediapathTextbox.text())
|
self.config['file'] = unicode(self.mediapathTextbox.text())
|
||||||
|
self.config['publicServers'] = self.publicServerAddresses
|
||||||
|
|
||||||
self.pressedclosebutton = False
|
self.pressedclosebutton = False
|
||||||
self.close()
|
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:
|
if (self.hostCombobox.currentText() == "" and self.serverpassTextbox.text() == "") or unicode(self.hostCombobox.currentText()) in self.publicServerAddresses:
|
||||||
self.serverpassLabel.hide()
|
self.serverpassLabel.hide()
|
||||||
self.serverpassTextbox.hide()
|
self.serverpassTextbox.hide()
|
||||||
self.serverpassTextbox.setText("")
|
|
||||||
else:
|
else:
|
||||||
self.serverpassLabel.show()
|
self.serverpassLabel.show()
|
||||||
self.serverpassTextbox.show()
|
self.serverpassTextbox.show()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user