Page MenuHomePhorge

matrix-event.cpp
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

matrix-event.cpp

/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include <libkazv-config.hpp>
#include <immer/config.hpp> // https://github.com/arximboldi/immer/issues/168
#include "matrix-event.hpp"
#include "helper.hpp"
using namespace Kazv;
MatrixEvent::MatrixEvent(lager::reader<Event> event, QObject *parent)
: QObject(parent)
, m_event(event)
, LAGER_QT(eventId)(m_event.xform(zug::map([](Event e) { return e.id(); }) | strToQt))
, LAGER_QT(sender)(m_event.xform(zug::map([](Event e) { return e.sender(); }) | strToQt))
, LAGER_QT(type)(m_event.xform(zug::map([](Event e) { return e.type(); }) | strToQt))
, LAGER_QT(stateKey)(m_event.xform(zug::map([](Event e) { return e.stateKey(); }) | strToQt))
, LAGER_QT(content)(m_event.xform(zug::map([](Event e) { return e.content().get().get<QJsonObject>(); })))
, LAGER_QT(encrypted)(m_event.xform(zug::map([](Event e) { return e.encrypted(); })))
, LAGER_QT(isState)(m_event.map([](Event e) { return e.isState(); }))
, LAGER_QT(unsignedData)(m_event.map([](Event e) {
auto j = e.raw();
if (j.get().contains("unsigned")) {
return j.get()["unsigned"].template get<QJsonObject>();
} else {
return QJsonObject();
}
}))
{
}
MatrixEvent::~MatrixEvent() = default;

File Metadata

Mime Type
text/x-c
Expires
Sun, Dec 1, 1:17 PM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41702
Default Alt Text
matrix-event.cpp (1 KB)

Event Timeline