mirror of
https://github.com/Syncplay/syncplay
synced 2025-01-18 21:10:47 +00:00
Fix error when server run without --max-chat-message-length being set (#177)
This commit is contained in:
parent
83a5dde99a
commit
d7dd563394
@ -560,10 +560,14 @@ class SyncplayClient(object):
|
||||
elif not self.serverFeatures["sharedPlaylists"]:
|
||||
self.ui.showErrorMessage(getMessage("shared-playlists-disabled-by-server-error"))
|
||||
# TODO: Have messages for all unsupported & disabled features
|
||||
constants.MAX_CHAT_MESSAGE_LENGTH = self.serverFeatures["maxChatMessageLength"]
|
||||
constants.MAX_USERNAME_LENGTH = self.serverFeatures["maxUsernameLength"]
|
||||
constants.MAX_ROOM_NAME_LENGTH = self.serverFeatures["maxRoomNameLength"]
|
||||
constants.MAX_FILENAME_LENGTH = self.serverFeatures["maxFilenameLength"]
|
||||
if self.serverFeatures["maxChatMessageLength"] is not None:
|
||||
constants.MAX_CHAT_MESSAGE_LENGTH = self.serverFeatures["maxChatMessageLength"]
|
||||
if self.serverFeatures["maxUsernameLength"] is not None:
|
||||
constants.MAX_USERNAME_LENGTH = self.serverFeatures["maxUsernameLength"]
|
||||
if self.serverFeatures["maxRoomNameLength"] is not None:
|
||||
constants.MAX_ROOM_NAME_LENGTH = self.serverFeatures["maxRoomNameLength"]
|
||||
if self.serverFeatures["maxFilenameLength"] is not None:
|
||||
constants.MAX_FILENAME_LENGTH = self.serverFeatures["maxFilenameLength"]
|
||||
constants.MPV_SYNCPLAYINTF_CONSTANTS_TO_SEND = ["MaxChatMessageLength={}".format(constants.MAX_CHAT_MESSAGE_LENGTH),
|
||||
u"inputPromptStartCharacter={}".format(constants.MPV_INPUT_PROMPT_START_CHARACTER),
|
||||
u"inputPromptEndCharacter={}".format(constants.MPV_INPUT_PROMPT_END_CHARACTER),
|
||||
|
@ -27,7 +27,7 @@ class SyncFactory(Factory):
|
||||
self._motdFilePath = motdFilePath
|
||||
self.disableReady = disableReady
|
||||
self.disableChat = disableChat
|
||||
self.maxChatMessageLength = maxChatMessageLength
|
||||
self.maxChatMessageLength = maxChatMessageLength # if maxChatMessageLength is not None else constants.MAX_CHAT_MESSAGE_LENGTH
|
||||
if not isolateRooms:
|
||||
self._roomManager = RoomManager()
|
||||
else:
|
||||
@ -548,4 +548,4 @@ class ConfigurationGetter(object):
|
||||
self._argparser.add_argument('--disable-chat', action='store_true', help=getMessage("server-chat-argument"))
|
||||
self._argparser.add_argument('--salt', metavar='salt', type=str, nargs='?', help=getMessage("server-salt-argument"))
|
||||
self._argparser.add_argument('--motd-file', metavar='file', type=str, nargs='?', help=getMessage("server-motd-argument"))
|
||||
self._argparser.add_argument('--max-chat-message-length', metavar='maxChatMessageLength', type=int, nargs='?',help=getMessage("server-chat-maxchars-argument").format(constants.MAX_CHAT_MESSAGE_LENGTH))
|
||||
self._argparser.add_argument('--max-chat-message-length', metavar='maxChatMessageLength',type=int, nargs='?',help=getMessage("server-chat-maxchars-argument").format(constants.MAX_CHAT_MESSAGE_LENGTH))
|
||||
|
Loading…
Reference in New Issue
Block a user