diff options
author | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-01-21 10:51:45 +0100 |
---|---|---|
committer | Alexey Rusakov <Kitsune-Ral@users.sf.net> | 2022-01-21 10:51:45 +0100 |
commit | 59590c44716e0bbb4499b8ca9844ecd75d638a01 (patch) | |
tree | f89370900076450ebda504c6724d35503ce8fa81 /lib/events/reactionevent.cpp | |
parent | e1ffc58ab9abf6321f92a6b648d6f8da08b0924d (diff) | |
parent | 0689028f4a0db403a55c6158e750fee3ba6c7098 (diff) | |
download | libquotient-59590c44716e0bbb4499b8ca9844ecd75d638a01.tar.gz libquotient-59590c44716e0bbb4499b8ca9844ecd75d638a01.zip |
Merge: merge event relation structures into one
Diffstat (limited to 'lib/events/reactionevent.cpp')
-rw-r--r-- | lib/events/reactionevent.cpp | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/lib/events/reactionevent.cpp b/lib/events/reactionevent.cpp deleted file mode 100644 index b53fffd6..00000000 --- a/lib/events/reactionevent.cpp +++ /dev/null @@ -1,29 +0,0 @@ -// SPDX-FileCopyrightText: 2019 Kitsune Ral <kitsune-ral@users.sf.net> -// SPDX-License-Identifier: LGPL-2.1-or-later - -#include "reactionevent.h" - -using namespace Quotient; - -void JsonObjectConverter<EventRelation>::dumpTo( - QJsonObject& jo, const EventRelation& pod) -{ - if (pod.type.isEmpty()) { - qCWarning(MAIN) << "Empty relation type; won't dump to JSON"; - return; - } - jo.insert(QStringLiteral("rel_type"), pod.type); - jo.insert(EventIdKey, pod.eventId); - if (pod.type == EventRelation::Annotation()) - jo.insert(QStringLiteral("key"), pod.key); -} - -void JsonObjectConverter<EventRelation>::fillFrom( - const QJsonObject& jo, EventRelation& pod) -{ - // The experimental logic for generic relationships (MSC1849) - fromJson(jo["rel_type"_ls], pod.type); - fromJson(jo[EventIdKeyL], pod.eventId); - if (pod.type == EventRelation::Annotation()) - fromJson(jo["key"_ls], pod.key); -} |