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

#include "callcandidatesevent.h"

/*
m.call.candidates
{
    "age": 242352,
    "content": {
        "call_id": "12345",
        "candidates": [
            {
                "candidate": "candidate:863018703 1 udp 2122260223 10.9.64.156
43670 typ host generation 0", "sdpMLineIndex": 0, "sdpMid": "audio"
            }
        ],
        "version": 0
    },
    "event_id": "$WLGTSEFSEF:localhost",
    "origin_server_ts": 1431961217939,
    "room_id": "!Cuyf34gef24t:localhost",
    "sender": "@example:localhost",
    "type": "m.call.candidates"
}
*/
#fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/******************************************************************************
 * THIS FILE IS GENERATED - ANY EDITS WILL BE OVERWRITTEN
 */

#pragma once

#include "jobs/basejob.h"

namespace Quotient {

/*! \brief Set the user's display name.
 *
 * This API sets the given user's display name. You must have permission to
 * set this user's display name, e.g. you need to have their ``access_token``.
 */
class SetDisplayNameJob : public BaseJob {
public:
    /*! \brief Set the user's display name.
     *
     * \param userId
     *   The user whose display name to set.
     *
     * \param displayname
     *   The new display name for this user.
     */
    explicit SetDisplayNameJob(const QString& userId,
                               const QString& displayname);
};

/*! \brief Get the user's display name.
 *
 * Get the user's display name. This API may be used to fetch the user's
 * own displayname or to query the name of other users; either locally or
 * on remote homeservers.
 */
class GetDisplayNameJob : public BaseJob {
public:
    /*! \brief Get the user's display name.
     *
     * \param userId
     *   The user whose display name to get.
     */
    explicit GetDisplayNameJob(const QString& userId);

    /*! \brief Construct a URL without creating a full-fledged job object
     *
     * This function can be used when a URL for GetDisplayNameJob
     * is necessary but the job itself isn't.
     */
    static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);

    // Result properties

    /// The user's display name if they have set one, otherwise not present.
    QString displayname() const
    {
        return loadFromJson<QString>("displayname"_ls);
    }
};

/*! \brief Set the user's avatar URL.
 *
 * This API sets the given user's avatar URL. You must have permission to
 * set this user's avatar URL, e.g. you need to have their ``access_token``.
 */
class SetAvatarUrlJob : public BaseJob {
public:
    /*! \brief Set the user's avatar URL.
     *
     * \param userId
     *   The user whose avatar URL to set.
     *
     * \param avatarUrl
     *   The new avatar URL for this user.
     */
    explicit SetAvatarUrlJob(const QString& userId, const QString& avatarUrl);
};

/*! \brief Get the user's avatar URL.
 *
 * Get the user's avatar URL. This API may be used to fetch the user's
 * own avatar URL or to query the URL of other users; either locally or
 * on remote homeservers.
 */
class GetAvatarUrlJob : public BaseJob {
public:
    /*! \brief Get the user's avatar URL.
     *
     * \param userId
     *   The user whose avatar URL to get.
     */
    explicit GetAvatarUrlJob(const QString& userId);

    /*! \brief Construct a URL without creating a full-fledged job object
     *
     * This function can be used when a URL for GetAvatarUrlJob
     * is necessary but the job itself isn't.
     */
    static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);

    // Result properties

    /// The user's avatar URL if they have set one, otherwise not present.
    QString avatarUrl() const { return loadFromJson<QString>("avatar_url"_ls); }
};

/*! \brief Get this user's profile information.
 *
 * Get the combined profile information for this user. This API may be used
 * to fetch the user's own profile information or other users; either
 * locally or on remote homeservers. This API may return keys which are not
 * limited to ``displayname`` or ``avatar_url``.
 */
class GetUserProfileJob : public BaseJob {
public:
    /*! \brief Get this user's profile information.
     *
     * \param userId
     *   The user whose profile information to get.
     */
    explicit GetUserProfileJob(const QString& userId);

    /*! \brief Construct a URL without creating a full-fledged job object
     *
     * This function can be used when a URL for GetUserProfileJob
     * is necessary but the job itself isn't.
     */
    static QUrl makeRequestUrl(QUrl baseUrl, const QString& userId);

    // Result properties

    /// The user's avatar URL if they have set one, otherwise not present.
    QString avatarUrl() const { return loadFromJson<QString>("avatar_url"_ls); }

    /// The user's display name if they have set one, otherwise not present.
    QString displayname() const
    {
        return loadFromJson<QString>("displayname"_ls);
    }
};

} // namespace Quotient