fix: Fix for request transaction shows wrong preview

I have added a check so that for a "request transaction" type , the "from" and publicKey are compared to find value of isCurrentUser.
In case of the send transaction will check for isCurrentUser via the from jsonMsg["commandParameters"]["from"] instead.

fixes #4048
This commit is contained in:
Khushboo Mehta 2021-11-09 17:40:00 +01:00 committed by Khushboo-dev-cpp
parent ffe6d5e0f0
commit 3f242713e9

View File

@ -211,10 +211,11 @@ proc toMessage*(jsonMsg: JsonNode, logMessage: bool = false): Message =
# the "Message" is contained as an address in the wallet of logged in user. If yes, means that
# currently logged in user has initiated a transaction (he is a sender), otherwise currently
# logged in user is a recipient.
message.isCurrentUser = currentUserWalletContainsAddress(message.commandParameters.fromAddress)
if message.commandParameters.fromAddress != "":
message.isCurrentUser = currentUserWalletContainsAddress(message.commandParameters.fromAddress)
message.hasMention = concat(message.parsedText.map(
t => t.children.filter(
c => c.textType == "mention" and c.literal == publicChatKey))).len > 0
result = message
result = message