Ver Fonte

Stringify some more chat IDs

Tulir Asokan há 2 anos atrás
pai
commit
10ad143966

+ 1 - 1
mautrix_signal/db/message.py

@@ -105,7 +105,7 @@ class Message:
         WHERE sender=$1 AND timestamp=$2 AND signal_chat_id=$3 AND signal_receiver=$4
         """
         return cls._from_row(
-            await cls.db.fetchrow(q, sender, timestamp, signal_chat_id, signal_receiver)
+            await cls.db.fetchrow(q, sender, timestamp, str(signal_chat_id), signal_receiver)
         )
 
     @classmethod

+ 1 - 1
mautrix_signal/db/portal.py

@@ -107,7 +107,7 @@ class Portal:
     @classmethod
     async def get_by_chat_id(cls, chat_id: GroupID | UUID, receiver: str = "") -> Portal | None:
         q = f"SELECT {cls._columns} FROM portal WHERE chat_id=$1 AND receiver=$2"
-        return cls._from_row(await cls.db.fetchrow(q, chat_id, receiver))
+        return cls._from_row(await cls.db.fetchrow(q, str(chat_id), receiver))
 
     @classmethod
     async def find_private_chats_of(cls, receiver: str) -> list[Portal]:

+ 1 - 1
mautrix_signal/db/reaction.py

@@ -129,7 +129,7 @@ class Reaction:
         return cls._from_row(
             await cls.db.fetchrow(
                 q,
-                chat_id,
+                str(chat_id),
                 receiver,
                 msg_author,
                 msg_timestamp,