aboutsummaryrefslogtreecommitdiff
path: root/lib/room.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/room.cpp')
-rw-r--r--lib/room.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/room.cpp b/lib/room.cpp
index 3b00d2d9..7e0806a7 100644
--- a/lib/room.cpp
+++ b/lib/room.cpp
@@ -224,9 +224,15 @@ public:
return evt;
}
- const QHash<StateEventKey, const StateEventBase*> stateEvents() const
+ QVector<const StateEventBase*> stateEventsOfType(const QString& evtType) const
{
- return currentState;
+ QVector<const StateEventBase*> vals = QVector<const StateEventBase*>();
+ for (const auto* val : currentState) {
+ if (val->matrixType() == evtType) {
+ vals.append(val);
+ }
+ }
+ return vals;
}
template <typename EventT>
@@ -1298,9 +1304,15 @@ const StateEventBase* Room::getCurrentState(const QString& evtType,
return d->getCurrentState({ evtType, stateKey });
}
-const QHash<StateEventKey, const StateEventBase*> Room::stateEvents() const
+const QVector<const StateEventBase*>
+Room::stateEventsOfType(const QString& evtType) const
+{
+ return d->stateEventsOfType(evtType);
+}
+
+const QHash<StateEventKey, const StateEventBase*>& Room::currentState() const
{
- return d->stateEvents();
+ return d->currentState;
}
RoomEventPtr Room::decryptMessage(const EncryptedEvent& encryptedEvent)