aboutsummaryrefslogtreecommitdiff
path: root/lib/events/callinviteevent.h
blob: 304c89acaf8bdb8aae6b42d07b4757672c8d45c6 (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
/******************************************************************************
 * SPDX-FileCopyrightText: 2017 Marius Gripsgard <marius@ubports.com>
 *
 * SPDX-License-Identifier: LGPL-2.1-or-later
 */

#pragma once

#include "roomevent.h"

namespace Quotient {
class CallInviteEvent : public CallEventBase {
public:
    DEFINE_EVENT_TYPEID("m.call.invite", CallInviteEvent)

    explicit CallInviteEvent(const QJsonObject& obj);

    explicit CallInviteEvent(const QString& callId, const int lifetime,
                             const QString& sdp);

    int lifetime() const
    {
        return content<int>("lifetime"_ls);
    } // FIXME: Omittable<>?
    QString sdp() const
    {
        return contentJson()["offer"_ls].toObject().value("sdp"_ls).toString();
    }
};

REGISTER_EVENT_TYPE(CallInviteEvent)
} // namespace Quotient