summary refs log tree commit diff
path: root/src/TimelineView.cc
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2017-06-01 18:55:42 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2017-06-01 18:55:42 +0300
commit5c283a5cda4fefef0d27d902bc4b71f3c71c78d1 (patch)
treebe28bb3860c225f0eea50fe821f802c4a683330d /src/TimelineView.cc
parentBe explicit about the text color on the context menu (diff)
downloadnheko-5c283a5cda4fefef0d27d902bc4b71f3c71c78d1.tar.xz
Don't mark messages from local user as unread
closes #37
Diffstat (limited to 'src/TimelineView.cc')
-rw-r--r--src/TimelineView.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/TimelineView.cc b/src/TimelineView.cc

index dbea0ad4..5cd59fe5 100644 --- a/src/TimelineView.cc +++ b/src/TimelineView.cc
@@ -213,6 +213,9 @@ int TimelineView::addEvents(const Timeline &timeline) { int message_count = 0; + QSettings settings; + QString localUser = settings.value("auth/user_id").toString(); + if (isInitialSync) { prev_batch_token_ = timeline.previousBatch(); isInitialSync = false; @@ -220,10 +223,13 @@ int TimelineView::addEvents(const Timeline &timeline) for (const auto &event : timeline.events()) { TimelineItem *item = parseMessageEvent(event.toObject(), TimelineDirection::Bottom); + auto sender = event.toObject().value("sender").toString(); if (item != nullptr) { - message_count += 1; addTimelineItem(item, TimelineDirection::Bottom); + + if (sender != localUser) + message_count += 1; } }