aboutsummaryrefslogtreecommitdiff
path: root/lib/events/roomkeyevent.cpp
blob: 3a8601d1867265d75f1179f414306288bd08fc81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-FileCopyrightText: 2019 Alexey Andreyev <aa13q@ya.ru>
// SPDX-License-Identifier: LGPL-2.1-or-later

#include "roomkeyevent.h"

using namespace Quotient;

RoomKeyEvent::RoomKeyEvent(const QJsonObject &obj) : Event(TypeId, obj)
{
    if (roomId().isEmpty())
        qCWarning(E2EE) << "Room key event has empty room id";
}

RoomKeyEvent::RoomKeyEvent(const QString& algorithm, const QString& roomId,
                           const QString& sessionId, const QString& sessionKey)
    : Event(TypeId, basicJson(TypeId, {
                                          { "algorithm", algorithm },
                                          { "room_id", roomId },
                                          { "session_id", sessionId },
                                          { "session_key", sessionKey },
                                      }))
{}