summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-27 21:07:39 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-03-27 21:07:39 +0300
commit0a09ce0f7546a040c6c69a0cfe3b2221ed5a9685 (patch)
treeba26930544e1dd30cb1a61d470325f033d097687 /src
parentFix invite button colors on the system theme (diff)
downloadnheko-0a09ce0f7546a040c6c69a0cfe3b2221ed5a9685.tar.xz
Update first & last sender after message deletion
fixes #282
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineView.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/timeline/TimelineView.cc b/src/timeline/TimelineView.cc

index ce6b061a..a00f4df5 100644 --- a/src/timeline/TimelineView.cc +++ b/src/timeline/TimelineView.cc
@@ -753,6 +753,20 @@ TimelineView::removeEvent(const QString &event_id) prevLabel->deleteLater(); } + // If we deleted the last item in the timeline... + if (!nextItem && prevItem) + lastSender_ = prevItem->descriptionMessage().userid; + + // If we deleted the first item in the timeline... + if (!prevItem && nextItem) + firstSender_ = nextItem->descriptionMessage().userid; + + // If we deleted the only item in the timeline... + if (!prevItem && !nextItem) { + firstSender_.clear(); + lastSender_.clear(); + } + // Finally remove the event. removedItem->deleteLater(); eventIds_.remove(event_id);