Make use of new RoomMember item from libquotient

Depends on https://github.com/quotient-im/libQuotient/pull/695

Currently basic just to show a working implementation using RoomMember. Currently only the room event and search models are moved over. Will change everything else over once the dependent pr is complete.
This commit is contained in:
James Graham
2024-05-05 17:03:28 +00:00
committed by Tobias Fella
parent 58d727350d
commit 430bafafe7
52 changed files with 332 additions and 603 deletions

View File

@@ -5,13 +5,8 @@
#include "neochatroom.h"
#include <QAbstractListModel>
#include <QQmlEngine>
#include <Quotient/events/reactionevent.h>
namespace Quotient
{
class User;
}
#include <Quotient/roommember.h>
/**
* @class ReactionModel
@@ -30,7 +25,7 @@ public:
*/
struct Reaction {
QString reaction; /**< The reaction emoji. */
QVariantList authors; /**< The list of authors who sent the given reaction. */
QList<Quotient::RoomMember> authors; /**< The list of authors who sent the given reaction. */
};
/**
@@ -40,8 +35,7 @@ public:
TextContentRole = Qt::DisplayRole, /**< The text to show in the reaction. */
ReactionRole, /**< The reaction emoji. */
ToolTipRole, /**< The tool tip to show for the reaction. */
AuthorsRole, /**< The list of authors who sent the given reaction. */
HasLocalUser, /**< Whether the local user is in the list of authors. */
HasLocalMember, /**< Whether the local member is in the list of authors. */
};
explicit ReactionModel(const Quotient::RoomMessageEvent *event, NeoChatRoom *room);