parent
366a006c4c
commit
5c7dc4c330
|
@ -171,6 +171,11 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
||||||
|
|
||||||
if(messages.len > 0):
|
if(messages.len > 0):
|
||||||
for m in messages:
|
for m in messages:
|
||||||
|
# https://github.com/status-im/status-desktop/issues/7632 will introduce deleteFroMe feature.
|
||||||
|
# Now we just skip deleted messages
|
||||||
|
if m.deleted or m.deletedForMe:
|
||||||
|
continue
|
||||||
|
|
||||||
let sender = self.controller.getContactDetails(m.`from`)
|
let sender = self.controller.getContactDetails(m.`from`)
|
||||||
|
|
||||||
let renderedMessageText = self.controller.getRenderedText(m.parsedText)
|
let renderedMessageText = self.controller.getRenderedText(m.parsedText)
|
||||||
|
@ -274,7 +279,12 @@ method messageAdded*(self: Module, message: MessageDto) =
|
||||||
let index = self.view.model().findIndexForMessageId(message.replace)
|
let index = self.view.model().findIndexForMessageId(message.replace)
|
||||||
if(index != -1):
|
if(index != -1):
|
||||||
self.view.model().removeItem(message.replace)
|
self.view.model().removeItem(message.replace)
|
||||||
|
|
||||||
|
# https://github.com/status-im/status-desktop/issues/7632 will introduce deleteFroMe feature.
|
||||||
|
# Now we just skip deleted messages
|
||||||
|
if message.deleted or message.deletedForMe:
|
||||||
|
return
|
||||||
|
|
||||||
var item = initItem(
|
var item = initItem(
|
||||||
message.id,
|
message.id,
|
||||||
message.communityId,
|
message.communityId,
|
||||||
|
|
|
@ -104,6 +104,8 @@ type MessageDto* = object
|
||||||
contactRequestState*: int
|
contactRequestState*: int
|
||||||
links*: seq[string]
|
links*: seq[string]
|
||||||
editedAt*: int
|
editedAt*: int
|
||||||
|
deleted*: bool
|
||||||
|
deletedForMe*: bool
|
||||||
transactionParameters*: TransactionParameters
|
transactionParameters*: TransactionParameters
|
||||||
|
|
||||||
proc toParsedText*(jsonObj: JsonNode): ParsedText =
|
proc toParsedText*(jsonObj: JsonNode): ParsedText =
|
||||||
|
@ -208,6 +210,8 @@ proc toMessageDto*(jsonObj: JsonNode): MessageDto =
|
||||||
discard jsonObj.getProp("contactRequestState", result.contactRequestState)
|
discard jsonObj.getProp("contactRequestState", result.contactRequestState)
|
||||||
discard jsonObj.getProp("image", result.image)
|
discard jsonObj.getProp("image", result.image)
|
||||||
discard jsonObj.getProp("editedAt", result.editedAt)
|
discard jsonObj.getProp("editedAt", result.editedAt)
|
||||||
|
discard jsonObj.getProp("deleted", result.deleted)
|
||||||
|
discard jsonObj.getProp("deletedForMe", result.deletedForMe)
|
||||||
|
|
||||||
var quotedMessageObj: JsonNode
|
var quotedMessageObj: JsonNode
|
||||||
if(jsonObj.getProp("quotedMessage", quotedMessageObj)):
|
if(jsonObj.getProp("quotedMessage", quotedMessageObj)):
|
||||||
|
|
Loading…
Reference in New Issue