aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Matrix.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-17 14:05:53 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-17 14:05:53 +0100
commitbf544dfabcd87e7fe826307a9ee34cc684806023 (patch)
tree4175e80bc73da511134d2a76a2dd15563eabee20 /src/plugins/Matrix.cpp
parentc36d883a90dac83b5a227ebd2d88b7b868d9f422 (diff)
Matrix: fix duplicate notifications on mention for initial sync
Diffstat (limited to 'src/plugins/Matrix.cpp')
-rw-r--r--src/plugins/Matrix.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index e53df9c..78ddac7 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -493,11 +493,11 @@ namespace QuickMedia {
//std::string room_desc = matrix->message_get_author_displayname(it.second.back().get()) + ": " + extract_first_line_elipses(it.second.back()->body, 150);
//room_body_item->set_description(std::move(room_desc));
- if(!it.second.sync_is_cache) {
+ if(!it.second.sync_is_cache && it.second.message_dir == MessageDirection::AFTER && !is_initial_sync) {
for(auto &message : messages) {
if(message->mentions_me) {
// TODO: What if the message or username begins with "-"? also make the notification image be the avatar of the user
- if((!is_window_focused || room != current_room || is_initial_sync || page_type == MatrixPageType::ROOM_LIST) && message->related_event_type != RelatedEventType::EDIT && message->related_event_type != RelatedEventType::REDACTION)
+ if((!is_window_focused || room != current_room || page_type == MatrixPageType::ROOM_LIST) && message->related_event_type != RelatedEventType::EDIT && message->related_event_type != RelatedEventType::REDACTION)
show_notification("QuickMedia matrix - " + matrix->message_get_author_displayname(message.get()) + " (" + room->get_name() + ")", message->body);
}
}