fix: identify messages sent by the current user

This commit is contained in:
Richard Ramos 2020-06-08 16:50:33 -04:00 committed by Iuri Matias
parent 40a523851d
commit ae3d3d3894
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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
)