Skip to content
Snippets Groups Projects
Commit 5c283a5c authored by Konstantinos Sideris's avatar Konstantinos Sideris
Browse files

Don't mark messages from local user as unread

closes #37
parent 4a026b15
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment