diff options
author | Arnav Rawat <rawat.arnav@gmail.com> | 2021-05-25 14:01:51 -0500 |
---|---|---|
committer | Arnav Rawat <rawat.arnav@gmail.com> | 2021-05-25 14:17:23 -0500 |
commit | 17bf4d180297c7e87363e179b8afa79ddb15dca7 (patch) | |
tree | 040ebd91aba3ab61d62a572e0d16da344b2619b6 /lib/room.cpp | |
parent | 28823df2af5a4bfbab6dc455252c8ea0e211ffcb (diff) | |
download | libquotient-17bf4d180297c7e87363e179b8afa79ddb15dca7.tar.gz libquotient-17bf4d180297c7e87363e179b8afa79ddb15dca7.zip |
Fixes
Diffstat (limited to 'lib/room.cpp')
-rw-r--r-- | lib/room.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/room.cpp b/lib/room.cpp index ed07868b..2a9cc0d8 100644 --- a/lib/room.cpp +++ b/lib/room.cpp @@ -557,13 +557,17 @@ QString Room::canonicalAlias() const QString Room::displayName() const { return d->displayname; } -QList<const RoomEvent*> Room::pinnedEvents() const +QStringList Room::pinnedEventIds() const { + return d->getCurrentState<RoomPinnedEvent>()->pinnedEvents(); +} + +QVector< const Quotient::RoomEvent* > Quotient::Room::pinnedEvents() const { QStringList events = d->getCurrentState<RoomPinnedEvent>()->pinnedEvents(); - QList<const RoomEvent*> pinnedEvents; + QVector<const RoomEvent*> pinnedEvents; QStringList::iterator i; for (i = events.begin(); i != events.end(); ++i) { - auto timelineItem = findInTimeline(*i); + auto timelineItem = findInTimeline(*i); if (timelineItem != historyEdge()) pinnedEvents.append(timelineItem->event()); } @@ -1843,7 +1847,7 @@ void Room::setCanonicalAlias(const QString& newAlias) d->requestSetState<RoomCanonicalAliasEvent>(newAlias, altAliases()); } -void Room::setPinnedMessages(const QStringList& events) +void Room::setPinnedEvents(const QStringList& events) { d->requestSetState<RoomPinnedEvent>(events); } @@ -2610,6 +2614,10 @@ Room::Changes Room::processStateEvent(const RoomEvent& e) return AliasesChange; // clang-format off } + , [this] (const RoomPinnedEvent&) { + emit pinnedEventsChanged(); + return OtherChange; + } , [] (const RoomTopicEvent&) { return TopicChange; } |