mirror of
https://github.com/status-im/status-lib.git
synced 2025-01-12 21:44:57 +00:00
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:
parent
ffe6d5e0f0
commit
3f242713e9
@ -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
|
# 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
|
# currently logged in user has initiated a transaction (he is a sender), otherwise currently
|
||||||
# logged in user is a recipient.
|
# 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(
|
message.hasMention = concat(message.parsedText.map(
|
||||||
t => t.children.filter(
|
t => t.children.filter(
|
||||||
c => c.textType == "mention" and c.literal == publicChatKey))).len > 0
|
c => c.textType == "mention" and c.literal == publicChatKey))).len > 0
|
||||||
|
|
||||||
result = message
|
result = message
|
||||||
|
Loading…
x
Reference in New Issue
Block a user