Fixed trailing newlines breaking messages (#300)
This commit is contained in:
parent
5f552ce0df
commit
2143b7dcf1
@ -830,6 +830,10 @@ class SyncplayClient(object):
|
|||||||
@requireServerFeature("chat")
|
@requireServerFeature("chat")
|
||||||
def sendChat(self, message):
|
def sendChat(self, message):
|
||||||
if self._protocol and self._protocol.logged:
|
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)
|
message = utils.truncateText(message, constants.MAX_CHAT_MESSAGE_LENGTH)
|
||||||
self._protocol.sendChatMessage(message)
|
self._protocol.sendChatMessage(message)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user