fix: identify messages sent by the current user
This commit is contained in:
parent
40a523851d
commit
ae3d3d3894
|
@ -53,7 +53,7 @@ proc toMessage*(jsonMsg: JsonNode): Message =
|
|||
text: jsonMsg{"text"}.getStr,
|
||||
timestamp: $jsonMsg{"timestamp"}.getInt,
|
||||
whisperTimestamp: $jsonMsg{"whisperTimestamp"}.getInt,
|
||||
isCurrentUser: false, # TODO: this must compare the fromAuthor against current user because the messages received from the mailserver will arrive as signals too, and those include the current user messages
|
||||
isCurrentUser: $jsonMsg{"outgoingStatus"}.getStr == "sending",
|
||||
stickerHash: ""
|
||||
)
|
||||
if result.contentType == 2:
|
||||
|
|
|
@ -39,7 +39,7 @@ proc toChatMessage*(payload: JsonNode): ChatMessage =
|
|||
timestamp: $payload["timestamp"],
|
||||
clock: payload["clock"].getInt,
|
||||
identicon: payload["identicon"].str,
|
||||
isCurrentUser: false, # TODO: compare the "from" to the current user
|
||||
isCurrentUser: payload{"outgoingStatus"}.getStr == "sending",
|
||||
contentType: payload["contentType"].getInt,
|
||||
sticker: "" # TODO: implement when implementing stickers from user
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue