ayn2op / discordo

A lightweight, secure, and feature-rich Discord terminal client.
MIT License
2.25k stars 70 forks source link

Store ID instead of index of message #436

Closed Retropaint closed 2 months ago

Retropaint commented 2 months ago

Closes #434 and #407

messagesText.selectedMessage and messageInput.replyMessageIdx have been replaced with messagesText.selectedMessageID and messagesInput.replyMessageID, respectively. Of course, everything else pertaining to the old vars and logic has been changed as well.

SelectPrev & Next now use a new func, getSelectedMessageIdx, to get index of the current message pointed by the ID to move around.

Since replies now also use ID, there are no more misalignment issues. This closes #407 but also ensure that this kind of bug won't be a thing going forward.

Hopefully the revamp isn't too crazy. :P