Fixed trailing newlines breaking messages (#300)

This commit is contained in:
et0h 2020-04-18 20:03:48 +01:00
parent 5f552ce0df
commit 2143b7dcf1
1 changed files with 4 additions and 0 deletions

View File

@ -830,6 +830,10 @@ class SyncplayClient(object):
@requireServerFeature("chat")
def sendChat(self, message):
if self._protocol and self._protocol.logged:
try:
message = message.replace("\n", "").replace("\r", "")
except:
pass
message = utils.truncateText(message, constants.MAX_CHAT_MESSAGE_LENGTH)
self._protocol.sendChatMessage(message)