aboutsummaryrefslogtreecommitdiff
path: root/lib/csapi/create_room.cpp
AgeCommit message (Expand)Author
2021-10-04Regenerate CS API files upon the previous commitAlexey Rusakov
2020-06-07Update generated files according to gtad/* changesKitsune Ral
2020-04-17Regenerate API files using new GTAD and refreshed templatesKitsune Ral
2019-08-09Namespace: QMatrixClient -> Quotient (with back comp alias)Kitsune Ral
2019-06-24Merge branch 'master' into clang-formatKitsune Ral
2019-06-07Generated files in csapi/: switch from now-deprecated JsonParserError to Inco...Kitsune Ral
2019-03-02style: apply .clang-format to all .cpp and .h filesMarc Deop
2018-12-13Merge branch 'kitsune-omittable-bool' into kitsune-lazy-loadingKitsune Ral
2018-12-13Regenerate csapi/Kitsune Ral
2018-12-08Refactor toJson/fillJsonKitsune Ral
2018-09-29Prepare for CS API 0.4.0Kitsune Ral
2018-08-25Update to the recent CS API (watch out for breakage)Kitsune Ral
2018-07-04lib/csapi: Updated from the latest API definitionsKitsune Ral
2018-07-04Use QStringLiteral() and operator"" _ls() in network jobsKitsune Ral
2018-06-09csapi: Now really fix passing query parametersKitsune Ral
2018-06-02csapi: Use Omittable<> container instead of intrusive 'omitted' fieldKitsune Ral
2018-05-26lib/csapi/: regenerate job classes from the most recent templatesKitsune Ral
2018-05-06Optimise #includes, eliminate some excess blank lines in lib/csapiKitsune Ral
2018-05-04New home for the generated code - lib/csapiKitsune Ral
.w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #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 */
// SPDX-FileCopyrightText: 2017 Elvis Angelaccio <elvid.angelaccio@kde.org>
// SPDX-FileCopyrightText: 2017 Kitsune Ral <kitsune-ral@users.sf.net>
// SPDX-License-Identifier: LGPL-2.1-or-later

#pragma once

#include <QtCore/QElapsedTimer>
#include <QtCore/QLoggingCategory>

Q_DECLARE_LOGGING_CATEGORY(MAIN)
Q_DECLARE_LOGGING_CATEGORY(STATE)
Q_DECLARE_LOGGING_CATEGORY(MEMBERS)
Q_DECLARE_LOGGING_CATEGORY(MESSAGES)
Q_DECLARE_LOGGING_CATEGORY(EVENTS)
Q_DECLARE_LOGGING_CATEGORY(EPHEMERAL)
Q_DECLARE_LOGGING_CATEGORY(E2EE)
Q_DECLARE_LOGGING_CATEGORY(JOBS)
Q_DECLARE_LOGGING_CATEGORY(SYNCJOB)
Q_DECLARE_LOGGING_CATEGORY(PROFILER)

namespace Quotient {
// QDebug manipulators

using QDebugManip = QDebug (*)(QDebug);

/**
 * @brief QDebug manipulator to setup the stream for JSON output
 *
 * Originally made to encapsulate the change in QDebug behavior in Qt 5.4
 * and the respective addition of QDebug::noquote().
 * Together with the operator<<() helper, the proposed usage is
 * (similar to std:: I/O manipulators):
 *
 * @example qCDebug() << formatJson << json_object; // (QJsonObject, etc.)
 */
inline QDebug formatJson(QDebug debug_object)
{
#if QT_VERSION < QT_VERSION_CHECK(5, 4, 0)
    return debug_object;
#else
    return debug_object.noquote();
#endif
}

/**
 * @brief A helper operator to facilitate usage of formatJson (and possibly
 * other manipulators)
 *
 * @param debug_object to output the json to
 * @param qdm a QDebug manipulator
 * @return a copy of debug_object that has its mode altered by qdm
 */
inline QDebug operator<<(QDebug debug_object, QDebugManip qdm)
{
    return qdm(debug_object);
}

inline qint64 profilerMinNsecs()
{
    return
#ifdef PROFILER_LOG_USECS
        PROFILER_LOG_USECS
#else
        200
#endif
        * 1000;
}
} // namespace Quotient
/// \deprecated Use namespace Quotient instead
namespace QMatrixClient = Quotient;

inline QDebug operator<<(QDebug debug_object, const QElapsedTimer& et)
{
    auto val = et.nsecsElapsed() / 1000;
    if (val < 1000)
        debug_object << val << "µs";
    else
        debug_object << val / 1000 << "ms";
    return debug_object;
}