aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roomcreateevent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/events/roomcreateevent.cpp')
-rw-r--r--lib/events/roomcreateevent.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/lib/events/roomcreateevent.cpp b/lib/events/roomcreateevent.cpp
index bb6de648..3b5024d5 100644
--- a/lib/events/roomcreateevent.cpp
+++ b/lib/events/roomcreateevent.cpp
@@ -6,20 +6,11 @@
using namespace Quotient;
template <>
-struct Quotient::JsonConverter<RoomType> {
- static RoomType load(const QJsonValue& jv)
- {
- const auto& roomTypeString = jv.toString();
- for (auto it = RoomTypeStrings.begin(); it != RoomTypeStrings.end();
- ++it)
- if (roomTypeString == *it)
- return RoomType(it - RoomTypeStrings.begin());
-
- if (!roomTypeString.isEmpty())
- qCWarning(EVENTS) << "Unknown Room Type: " << roomTypeString;
- return RoomType::Undefined;
- }
-};
+RoomType Quotient::fromJson(const QJsonValue& jv)
+{
+ return enumFromJsonString(jv.toString(), RoomTypeStrings,
+ RoomType::Undefined);
+}
bool RoomCreateEvent::isFederated() const
{