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

@@ -56,11 +56,6 @@ public:
[[nodiscard]] NeoChatRoom *room() const;
void setRoom(NeoChatRoom *room);
/**
* @brief The user at the given index of the model.
*/
[[nodiscard]] Quotient::User *userAt(QModelIndex index) const;
/**
* @brief Get the given role value at the given index.
*
@@ -90,15 +85,15 @@ protected:
bool event(QEvent *event) override;
private Q_SLOTS:
void userAdded(Quotient::User *user);
void userRemoved(Quotient::User *user);
void refreshUser(Quotient::User *user, const QList<int> &roles = {});
void refreshAllUsers();
void memberJoined(const Quotient::RoomMember &member);
void memberLeft(const Quotient::RoomMember &member);
void refreshMember(const Quotient::RoomMember &member, const QList<int> &roles = {});
void refreshAllMembers();
private:
QPointer<NeoChatRoom> m_currentRoom;
QList<Quotient::User *> m_users;
QList<Quotient::RoomMember> m_members;
int findUserPos(Quotient::User *user) const;
int findUserPos(const Quotient::RoomMember &member) const;
[[nodiscard]] int findUserPos(const QString &username) const;
};