From a95d5e83b4d0ab3a9bf2adef1ae4246adc317d04 Mon Sep 17 00:00:00 2001 From: Arnav Rawat Date: Thu, 11 Mar 2021 16:09:55 -0600 Subject: Support for pinned messages Fixes issue #188 --- lib/events/simplestateevents.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib/events/simplestateevents.h') diff --git a/lib/events/simplestateevents.h b/lib/events/simplestateevents.h index d6261a8f..f22f313d 100644 --- a/lib/events/simplestateevents.h +++ b/lib/events/simplestateevents.h @@ -71,4 +71,21 @@ public: QStringList aliases() const { return content().value; } }; REGISTER_EVENT_TYPE(RoomAliasesEvent) + +class RoomPinnedEvent + : public StateEvent> +{ +public: + DEFINE_EVENT_TYPEID("m.room.pinned_messages", RoomPinnedEvent) + + explicit RoomPinnedEvent(const QJsonObject& json) + : StateEvent(typeId(), json, QStringLiteral("pinned")) + { } + explicit RoomPinnedEvent(const QStringList& roomEvents) + : StateEvent(typeId(), matrixTypeId(), {}, + QStringLiteral("pinned"), roomEvents) + { } + QStringList pinnedEvents() const { return content().value; } +}; +REGISTER_EVENT_TYPE(RoomPinnedEvent) } // namespace Quotient -- cgit v1.2.3 From 17bf4d180297c7e87363e179b8afa79ddb15dca7 Mon Sep 17 00:00:00 2001 From: Arnav Rawat Date: Tue, 25 May 2021 14:01:51 -0500 Subject: Fixes --- lib/events/simplestateevents.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'lib/events/simplestateevents.h') diff --git a/lib/events/simplestateevents.h b/lib/events/simplestateevents.h index f22f313d..c977cb6e 100644 --- a/lib/events/simplestateevents.h +++ b/lib/events/simplestateevents.h @@ -55,6 +55,7 @@ namespace EventContent { DEFINE_SIMPLE_STATE_EVENT(RoomNameEvent, "m.room.name", QString, name) DEFINE_SIMPLE_STATE_EVENT(RoomTopicEvent, "m.room.topic", QString, topic) +DEFINE_SIMPLE_STATE_EVENT(RoomPinnedEvent, "m.room.pinned_messages", QStringList, pinnedEvents) class RoomAliasesEvent : public StateEvent> { @@ -71,21 +72,4 @@ public: QStringList aliases() const { return content().value; } }; REGISTER_EVENT_TYPE(RoomAliasesEvent) - -class RoomPinnedEvent - : public StateEvent> -{ -public: - DEFINE_EVENT_TYPEID("m.room.pinned_messages", RoomPinnedEvent) - - explicit RoomPinnedEvent(const QJsonObject& json) - : StateEvent(typeId(), json, QStringLiteral("pinned")) - { } - explicit RoomPinnedEvent(const QStringList& roomEvents) - : StateEvent(typeId(), matrixTypeId(), {}, - QStringLiteral("pinned"), roomEvents) - { } - QStringList pinnedEvents() const { return content().value; } -}; -REGISTER_EVENT_TYPE(RoomPinnedEvent) } // namespace Quotient -- cgit v1.2.3