Fix: Include pinned messages from threads in the main chat interface
Brief Title
This pull request addresses the issue where pinned messages in threads do not appear in the main chat interface. The solution involves fetching pinned messages from both the main chat and threads and combining them to ensure they are all displayed in the main chat interface.
Fixes #853
Video/Screenshots
https://github.com/user-attachments/assets/b7de966d-7cb9-4295-9d0d-d5c5297c4c73
PR Test Details
Note: The PR will be ready for live testing at https://rocketchat.github.io/EmbeddedChat/pulls/pr-<pr_number> after approval. Contributors are requested to replace <pr_number> with the actual PR number.
Done
Sorting can be time-consuming if there are a large number of pinned messages. However, to maintain consistency with Rocket.Chat, I have implemented sorting since pinned messages in Rocket.Chat are sorted.
Alternatively, we have two other approaches:
Implement pagination to fetch messages dynamically as the user scrolls to the bottom of the interface, ensuring only the required messages are loaded. Fetch messages directly from the server without sorting them at all. Which approach do you think would be best, @Spiral-Memory?
hey @Spiral-Memory , can you please take a look at this and let me know which approach would be suitable?