Skip to content

Commit

Permalink
Add attachemtns to raw sent message. fix parseMentions
Browse files Browse the repository at this point in the history
  • Loading branch information
pnearing committed Nov 27, 2022
1 parent b227b21 commit b56d38b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion signalSentMessage.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ def __fromRawMessage__(self, rawMessage: dict) -> None:
# Load body:
self.body = rawSentMessage['message']
# Load attachments:
# TODO: FIND A SENT MESSAGE WIT AN ATTACHMENT
self.attachments = None
if ('attachments' in rawSentMessage.keys()):
self.attachments = []
for rawAttachment in rawSentMessage['attachments']:
self.attachments.append( Attachment(configPath=self._configPath, rawAttachment=rawAttachment) )
# Load sticker:
self.sticker = None
if ('sticker' in rawSentMessage.keys()):
Expand Down Expand Up @@ -429,6 +433,8 @@ def getQuote(self) -> Quote:
return quote

def parseMentions(self) -> str:
if (self.mentions == None):
return self.body
return self.mentions.__parseMentions__(self.body)

def react(self, emoji:str) -> tuple[bool, Reaction | str]:
Expand Down

0 comments on commit b56d38b

Please sign in to comment.