2021-12-30 08:20:10 +03:00
|
|
|
// SPDX-FileCopyrightText: 2021 Nheko Contributors
|
2022-01-01 06:57:53 +03:00
|
|
|
// SPDX-FileCopyrightText: 2022 Nheko Contributors
|
2023-01-02 06:25:33 +03:00
|
|
|
// SPDX-FileCopyrightText: 2023 Nheko Contributors
|
2021-12-30 08:20:10 +03:00
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2021-12-30 06:54:03 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <mtx/events.hpp>
|
|
|
|
#include <mtx/events/presence.hpp>
|
|
|
|
|
2022-10-10 15:38:29 +03:00
|
|
|
class PresenceEmitter final : public QObject
|
2021-12-30 06:54:03 +03:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
PresenceEmitter(QObject *p = nullptr)
|
|
|
|
: QObject(p)
|
2022-09-25 21:05:08 +03:00
|
|
|
{
|
|
|
|
}
|
2021-12-30 06:54:03 +03:00
|
|
|
|
|
|
|
void sync(const std::vector<mtx::events::Event<mtx::events::presence::Presence>> &presences);
|
|
|
|
|
|
|
|
Q_INVOKABLE QString userPresence(QString id) const;
|
|
|
|
Q_INVOKABLE QString userStatus(QString id) const;
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void presenceChanged(QString userid);
|
|
|
|
};
|