aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorArnav Rawat <rawat.arnav@gmail.com>2021-03-11 18:33:54 -0600
committerArnav Rawat <rawat.arnav@gmail.com>2021-03-11 18:33:54 -0600
commit5155f825bb71fca649a97ac4a7fa356cf85ee722 (patch)
treee9083574b2ef6067bf9bf06480fe926f71b46d5d /lib
parent847bfdca018ce944360c47c18ffee8a4c3d20f5b (diff)
downloadlibquotient-5155f825bb71fca649a97ac4a7fa356cf85ee722.tar.gz
libquotient-5155f825bb71fca649a97ac4a7fa356cf85ee722.zip
historyedge() a result of findInTimeline()
Diffstat (limited to 'lib')
-rw-r--r--lib/room.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 4f7f7ca9..ed07868b 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -562,8 +562,11 @@ QList<const RoomEvent*> Room::pinnedEvents() const
QStringList events = d->getCurrentState<RoomPinnedEvent>()->pinnedEvents();
QList<const RoomEvent*> pinnedEvents;
QStringList::iterator i;
- for (i = events.begin(); i != events.end(); ++i)
- pinnedEvents.append(findInTimeline(*i)->event());
+ for (i = events.begin(); i != events.end(); ++i) {
+ auto timelineItem = findInTimeline(*i);
+ if (timelineItem != historyEdge())
+ pinnedEvents.append(timelineItem->event());
+ }
return pinnedEvents;
}