From 16c7256f555d41e8e86da3bcdf7990e75157b856 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 9 Feb 2021 17:54:49 +0100 Subject: The final solution to the room selection question --- src/QuickMedia.cpp | 1 + src/plugins/Matrix.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') 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(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); -- cgit v1.2.3