The intention is that NeochatRoomMember can be created passed to QML and then be fully managed by it. It effectively just grabs the current RoomMember, calls the correct function then discards it so that we don't end up trying to access an already deleted state event. (cherry picked from commit11fd4f88ec)a2a8ad09Create NeochatRoomMember as a shim for RoomMember so it can be safely passed to QML0867eef5Fix showAuthor0f72ccd0Mamange the creation of NeochatRoomMembers and only create one per member rather than event.dba88fe2REmove getAuthor as no longer needed4e3a61d1Update include32d4d9f7Pass NeochatRoomMembers rather than RoomMembers to menus8e4b2034Don't leak memoryc2f2bb26Fix code component regression.5aee89beMake sure the sender Id is intialised properly for pending eventsc10c2677Tweak intialisationb3146034Make sure event objects are created for new pending eventse4fab6d9Pass an empty NeochatRoomMember when not in the map Co-authored-by: James Graham <james.h.graham@protonmail.com>
54 lines
1.3 KiB
C++
54 lines
1.3 KiB
C++
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
|
|
// SPDX-License-Identifier: LGPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#include <QQmlEngine>
|
|
|
|
#include <Quotient/accountregistry.h>
|
|
#include <Quotient/e2ee/sssshandler.h>
|
|
#include <Quotient/keyverificationsession.h>
|
|
#include <Quotient/roommember.h>
|
|
|
|
#include "controller.h"
|
|
#include "neochatconfig.h"
|
|
|
|
struct ForeignConfig {
|
|
Q_GADGET
|
|
QML_FOREIGN(NeoChatConfig)
|
|
QML_NAMED_ELEMENT(Config)
|
|
QML_SINGLETON
|
|
public:
|
|
static NeoChatConfig *create(QQmlEngine *, QJSEngine *)
|
|
{
|
|
QQmlEngine::setObjectOwnership(NeoChatConfig::self(), QQmlEngine::CppOwnership);
|
|
return NeoChatConfig::self();
|
|
}
|
|
};
|
|
|
|
struct ForeignAccountRegistry {
|
|
Q_GADGET
|
|
QML_FOREIGN(Quotient::AccountRegistry)
|
|
QML_NAMED_ELEMENT(AccountRegistry)
|
|
QML_SINGLETON
|
|
public:
|
|
static Quotient::AccountRegistry *create(QQmlEngine *, QJSEngine *)
|
|
{
|
|
QQmlEngine::setObjectOwnership(&Controller::instance().accounts(), QQmlEngine::CppOwnership);
|
|
return &Controller::instance().accounts();
|
|
}
|
|
};
|
|
|
|
struct ForeignKeyVerificationSession {
|
|
Q_GADGET
|
|
QML_FOREIGN(Quotient::KeyVerificationSession)
|
|
QML_NAMED_ELEMENT(KeyVerificationSession)
|
|
QML_UNCREATABLE("")
|
|
};
|
|
|
|
struct ForeignSSSSHandler {
|
|
Q_GADGET
|
|
QML_FOREIGN(Quotient::SSSSHandler)
|
|
QML_NAMED_ELEMENT(SSSSHandler)
|
|
};
|