From: Alexander Schmidt Date: Sun, 4 Oct 2020 06:51:13 +0000 (+0200) Subject: use b64 encoding X-Git-Url: http://git.treefish.org/~alex/mtxbot.git/commitdiff_plain/6c4dbc2edd8bf5cac128c2fa48728d8abe52432e?ds=inline use b64 encoding --- diff --git a/src/presence.py b/src/presence.py index b3da858..7430ee8 100644 --- a/src/presence.py +++ b/src/presence.py @@ -72,6 +72,7 @@ class Presence: try: msgB64Bytes = line.rstrip("\n").encode("UTF-8") msgBytes = base64.b64decode(msgB64Bytes) + msgStr = msgBytes.decode("UTF-8") except: self._log(logging.WARNING, "Error decoding message") continue @@ -80,7 +81,7 @@ class Presence: message_type="m.room.message", content={ "msgtype": "m.text", - "body": msgBytes.decode("UTF-8") + "body": msgStr } ) else: