aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roomevent.cpp
diff options
context:
space:
mode:
authorAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-04 21:12:29 +0200
committerAlexey Rusakov <Kitsune-Ral@users.sf.net>2022-05-08 17:43:58 +0200
commit843f7a0ac2619a2f2863d457cdeaa03707255793 (patch)
tree3c518b467d318dc54b36b0bcf17cdb719d9e3cfe /lib/events/roomevent.cpp
parent4070706fcc91cd46054b00c5f3a267a9d8c44fb7 (diff)
downloadlibquotient-843f7a0ac2619a2f2863d457cdeaa03707255793.tar.gz
libquotient-843f7a0ac2619a2f2863d457cdeaa03707255793.zip
basic*EventJson() -> *Event::basicJson()
This makes it easier and more intuitive to build a minimal JSON payload for a given event type. A common basicJson() call point is also convenient in template contexts (see next commits).
Diffstat (limited to 'lib/events/roomevent.cpp')
-rw-r--r--lib/events/roomevent.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/events/roomevent.cpp b/lib/events/roomevent.cpp
index 2f482871..ebe72149 100644
--- a/lib/events/roomevent.cpp
+++ b/lib/events/roomevent.cpp
@@ -101,19 +101,19 @@ void RoomEvent::dumpTo(QDebug dbg) const
dbg << " (made at " << originTimestamp().toString(Qt::ISODate) << ')';
}
-QJsonObject makeCallContentJson(const QString& callId, int version,
- QJsonObject content)
+QJsonObject CallEventBase::basicJson(const QString& matrixType,
+ const QString& callId, int version,
+ QJsonObject content)
{
content.insert(QStringLiteral("call_id"), callId);
content.insert(QStringLiteral("version"), version);
- return content;
+ return RoomEvent::basicJson(matrixType, content);
}
CallEventBase::CallEventBase(Type type, event_mtype_t matrixType,
const QString& callId, int version,
const QJsonObject& contentJson)
- : RoomEvent(type, matrixType,
- makeCallContentJson(callId, version, contentJson))
+ : RoomEvent(type, basicJson(type, callId, version, contentJson))
{}
CallEventBase::CallEventBase(Event::Type type, const QJsonObject& json)