(This PR fixes the reply-bug that I mentioned in #353)
When replying to a message (replying to [username]), if the highlight is moved, the real message being replied to is the highlighted one (e.g. from [username2]) even though the title of the Message Input still says 'replying to [username]'.
This happens because in sendAction, the ms.selectedMessage is used to get the original message ID, however that changes when the user moves around in the Messages Text (for instance, to check another relevant message). Another issue with this implementation is that every message sent when there is a highlighted message automatically becomes a reply, regardless of if the user pressed the reply shortcut.
I solved this by adding a replyMessageID field to the Message Input, which stores the message ID when the user presses the reply shortcut.
Steps to reproduce wrong title in Message Input:
Send two messages with 'a' and 'b'
Focus on Messages Text, highlight the 'a' message
Press the reply shortcut (default: r)
Focus on Messages Text and highlight the 'b' message
Write and send a third message
Expected result:
The last message is a reply to the message 'a'
Actual result:
The last message is a reply to the message 'b'
Steps to reproduce reply message without using reply shortcut:
Send message with 'a'
Focus on Messages Text and highlight 'a'
Send a message (note that the Message Input does not have the 'replying to...' title)
Hi!
(This PR fixes the reply-bug that I mentioned in #353)
When replying to a message (replying to [username]), if the highlight is moved, the real message being replied to is the highlighted one (e.g. from [username2]) even though the title of the Message Input still says 'replying to [username]'.
This happens because in
sendAction
, thems.selectedMessage
is used to get the original message ID, however that changes when the user moves around in the Messages Text (for instance, to check another relevant message). Another issue with this implementation is that every message sent when there is a highlighted message automatically becomes a reply, regardless of if the user pressed the reply shortcut.I solved this by adding a
replyMessageID
field to the Message Input, which stores the message ID when the user presses the reply shortcut.Steps to reproduce wrong title in Message Input:
Expected result:
The last message is a reply to the message 'a'
Actual result:
The last message is a reply to the message 'b'
Steps to reproduce reply message without using reply shortcut:
Expected result:
The last message is not a reply
Actual result:
The last message is a reply to message 'a'