소스 검색

Merge pull request #5 from witchent/patch-1

Check if quoted message exists in db
Tulir Asokan 4 년 전
부모
커밋
65a924e92a
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      mautrix_signal/portal.py

+ 2 - 1
mautrix_signal/portal.py

@@ -174,7 +174,8 @@ class Portal(DBPortal, BasePortal):
         if message.get_reply_to():
             reply = await DBMessage.get_by_mxid(message.get_reply_to(), self.mxid)
             # TODO include actual text? either store in db or fetch event from homeserver
-            quote = Quote(id=reply.timestamp, author=Address(uuid=reply.sender), text="")
+            if reply is not None:
+                quote = Quote(id=reply.timestamp, author=Address(uuid=reply.sender), text="")
 
         text = message.body
         attachments: Optional[List[Attachment]] = None