aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-02-09 12:12:10 +0100
committerdec05eba <dec05eba@protonmail.com>2021-02-09 12:12:10 +0100
commit02071aa486675ab521d180adbdc830bedb17ffa2 (patch)
treecd383019452f348b11e33c54a11c0af26a6369e2
parent1fe091011c397d7b5ce5c3a6409b2351a791fa20 (diff)
Matrix: select first room on selection
-rw-r--r--src/QuickMedia.cpp3
-rw-r--r--src/plugins/Matrix.cpp1
2 files changed, 3 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 552ceae..5d4f7bd 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1114,6 +1114,7 @@ namespace QuickMedia {
} else if(new_tabs.size() == 1 && new_tabs[0].page->get_type() == PageTypez::CHAT) {
current_page = PageType::CHAT;
current_chat_room = matrix->get_room_by_id(selected_item->url);
+ tabs[selected_tab].body->select_first_item();
while(window.isOpen()) {
bool move_room = chat_page(static_cast<MatrixChatPage*>(new_tabs[0].page.get()), current_chat_room, tabs, selected_tab, tab_associated_data[selected_tab]);
if(!move_room)
@@ -3745,7 +3746,7 @@ namespace QuickMedia {
if(!message)
return;
- if(message->type >= MessageType::TEXT && message->type <= MessageType::FILE && is_window_focused && chat_state != ChatState::URL_SELECTION && !setting_read_marker && read_marker_timer.getElapsedTime().asMilliseconds() >= read_marker_timeout_ms) {
+ if(matrix->is_initial_sync_finished() && message->type >= MessageType::TEXT && message->type <= MessageType::FILE && is_window_focused && chat_state != ChatState::URL_SELECTION && !setting_read_marker && read_marker_timer.getElapsedTime().asMilliseconds() >= read_marker_timeout_ms) {
// TODO: What if two messages have the same timestamp?
if(message && !message->event_id.empty() && message->timestamp > current_room->last_read_message_timestamp) {
//read_marker_timeout_ms = read_marker_timeout_ms_default;
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 051e951..b16b551 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -515,6 +515,7 @@ namespace QuickMedia {
}
// The event id in encrypted rooms contain the timestamp. Sort by that if possible. Such messages contain a colon.
+ // TODO: Test if this also works with construct and other homeservers
Message *last_unread_message = nullptr;
if(read_marker_message_timestamp != 0 && last_new_message->timestamp > read_marker_message_timestamp)