diff options
author | Arnav Rawat <rawat.arnav@gmail.com> | 2021-03-11 16:09:55 -0600 |
---|---|---|
committer | Arnav Rawat <rawat.arnav@gmail.com> | 2021-03-11 16:09:55 -0600 |
commit | a95d5e83b4d0ab3a9bf2adef1ae4246adc317d04 (patch) | |
tree | cf0b9688caab0819d3de225230515508f00df52c /lib/events | |
parent | 337809639b5e9b3e78a4b33eafe0e1e3bb3288fc (diff) | |
download | libquotient-a95d5e83b4d0ab3a9bf2adef1ae4246adc317d04.tar.gz libquotient-a95d5e83b4d0ab3a9bf2adef1ae4246adc317d04.zip |
Support for pinned messages
Fixes issue #188
Diffstat (limited to 'lib/events')
-rw-r--r-- | lib/events/simplestateevents.h | 17 |
1 files changed, 17 insertions, 0 deletions
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<EventContent::SimpleContent<QStringList>> +{ +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 |