aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp16
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;
}