]> git.treefish.org Git - mtxbot.git/commitdiff
use b64 encoding
authorAlexander Schmidt <alex@treefish.org>
Sun, 4 Oct 2020 06:51:13 +0000 (08:51 +0200)
committerAlexander Schmidt <alex@treefish.org>
Sun, 4 Oct 2020 06:51:13 +0000 (08:51 +0200)
src/presence.py

index b3da8589dc1614fb250a2e0f352cfd441cdef0f3..7430ee814f4a5e02b2138fed820473964ba16454 100644 (file)
@@ -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: