aboutsummaryrefslogtreecommitdiff
path: root/lib/events/callcandidatesevent.h
blob: ae3bb150183b45e8aba53c1fbf1c61c4490ed489 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/******************************************************************************
 * SPDX-FileCopyrightText: 2017 Marius Gripsgard <marius@ubports.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once

#include "roomevent.h"

namespace Quotient {
class CallCandidatesEvent : public CallEventBase {
public:
    DEFINE_EVENT_TYPEID("m.call.candidates", CallCandidatesEvent)

    explicit CallCandidatesEvent(const QJsonObject& obj)
        : CallEventBase(typeId(), obj)
    {}

    explicit CallCandidatesEvent(const QString& callId,
                                 const QJsonArray& candidates)
        : CallEventBase(typeId(), matrixTypeId(), callId, 0,
                        { { QStringLiteral("candidates"), candidates } })
    {}

    QJsonArray candidates() const
    {
        return content<QJsonArray>("candidates"_ls);
    }
};

REGISTER_EVENT_TYPE(CallCandidatesEvent)
} // namespace Quotient