aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-02-09 17:54:49 +0100
committerdec05eba <dec05eba@protonmail.com>2021-02-09 17:54:49 +0100
commit16c7256f555d41e8e86da3bcdf7990e75157b856 (patch)
treee0c748a4af582360dca27257f0b64214a4c8bf6c
parent8a76402e6edd16931a3456abd59df7c2ba735220 (diff)
The final solution to the room selection question
-rw-r--r--plugins/Matrix.hpp1
-rw-r--r--src/QuickMedia.cpp1
-rw-r--r--src/plugins/Matrix.cpp2
3 files changed, 3 insertions, 1 deletions
diff --git a/plugins/Matrix.hpp b/plugins/Matrix.hpp
index 7b81b61..9fb35fe 100644
--- a/plugins/Matrix.hpp
+++ b/plugins/Matrix.hpp
@@ -203,6 +203,7 @@ namespace QuickMedia {
bool message_contains_user_mention(const std::string &msg, const std::string &username);
bool message_is_timeline(Message *message);
+ void body_set_selected_item(Body *body, BodyItem *selected_item);
enum class MatrixPageType {
ROOM_LIST,
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 0c3bb09..3bd75d6 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1112,6 +1112,7 @@ namespace QuickMedia {
current_page = PageType::VIDEO_CONTENT;
video_content_page(static_cast<VideoPage*>(new_tabs[0].page.get()), selected_item->url, selected_item->get_title(), false);
} else if(new_tabs.size() == 1 && new_tabs[0].page->get_type() == PageTypez::CHAT) {
+ body_set_selected_item(tabs[selected_tab].body.get(), selected_item);
current_page = PageType::CHAT;
current_chat_room = matrix->get_room_by_id(selected_item->url);
while(window.isOpen()) {
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 4b980a0..8e1e54e 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -415,7 +415,7 @@ namespace QuickMedia {
});
}
- static void body_set_selected_item(Body *body, BodyItem *selected_item) {
+ void body_set_selected_item(Body *body, BodyItem *selected_item) {
for(size_t i = 0; i < body->items.size(); ++i) {
if(body->items[i]->url == selected_item->url) {
body->set_selected_item(i);