aboutsummaryrefslogtreecommitdiff
path: root/lib/events/callinviteevent.h
blob: fc22f7e17643eb63bff525ec46cff8d013d3499d (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
// SPDX-FileCopyrightText: 2017 Marius Gripsgard <marius@ubports.com>
// SPDX-FileCopyrightText: 2018 Josip Delic <delijati@googlemail.com>
// SPDX-License-Identifier: LGPL-2.1-or-later

#pragma once

#include "roomevent.h"

namespace Quotient {
class QUOTIENT_API CallInviteEvent
    : public EventTemplate<CallInviteEvent, CallEventBase> {
public:
    QUO_EVENT(CallInviteEvent, "m.call.invite")

    using EventTemplate::EventTemplate;

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

    QUO_CONTENT_GETTER(int, lifetime)
    QString sdp() const
    {
        return contentPart<QJsonObject>("offer"_ls).value("sdp"_ls).toString();
    }
};
} // namespace Quotient