fix: prevent spam of "requested community doesn't exists"
The spam was caused by calling `getCommunityById` with empty id.
This commit is contained in:
parent
c83794470b
commit
5bf702fd09
|
@ -206,7 +206,6 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
|||
if message.deleted or message.deletedForMe:
|
||||
continue
|
||||
let chatDetails = self.controller.getChatDetails()
|
||||
let communityChats = self.controller.getCommunityById(chatDetails.communityId).chats
|
||||
|
||||
let sender = self.controller.getContactDetails(message.`from`)
|
||||
var quotedMessageAuthorDetails = ContactDetails()
|
||||
|
@ -216,6 +215,10 @@ method newMessagesLoaded*(self: Module, messages: seq[MessageDto], reactions: se
|
|||
else:
|
||||
quotedMessageAuthorDetails = self.controller.getContactDetails(message.quotedMessage.`from`)
|
||||
|
||||
var communityChats: seq[ChatDto]
|
||||
if chatDetails.communityId != "":
|
||||
communityChats = self.controller.getCommunityById(chatDetails.communityId).chats
|
||||
|
||||
let renderedMessageText = self.controller.getRenderedText(message.parsedText, communityChats)
|
||||
var transactionContract = message.transactionParameters.contract
|
||||
var transactionValue = message.transactionParameters.value
|
||||
|
|
Loading…
Reference in New Issue