diff --git a/src/MemberList.cpp b/src/MemberList.cpp
index 415e3b57..0ef3b696 100644
--- a/src/MemberList.cpp
+++ b/src/MemberList.cpp
@@ -22,7 +22,7 @@
#include "timeline/TimelineViewManager.h"
#include "ui/Avatar.h"
-MemberList::MemberList(const QString &room_id, QWidget *parent)
+MemberList::MemberList(const QString &room_id, QObject *parent)
: QAbstractListModel{parent}
, room_id_{room_id}
{
diff --git a/src/MemberList.h b/src/MemberList.h
index 070666a2..9932f6a4 100644
--- a/src/MemberList.h
+++ b/src/MemberList.h
@@ -25,7 +25,7 @@ public:
DisplayName,
AvatarUrl,
};
- MemberList(const QString &room_id, QWidget *parent = nullptr);
+ MemberList(const QString &room_id, QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 66d931fd..e9fa4a05 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -1067,9 +1067,9 @@ TimelineModel::openUserProfile(QString userid)
}
void
-TimelineModel::openRoomMembers()
+TimelineModel::openRoomMembers(QString room_id)
{
- MemberList *memberList = new MemberList(roomId());
+ MemberList *memberList = new MemberList(room_id == QString() ? roomId() : room_id, this);
emit openRoomMembersDialog(memberList);
}
diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 0d1eb1f9..077245cb 100644
--- a/src/timeline/TimelineModel.h
+++ b/src/timeline/TimelineModel.h
@@ -239,7 +239,7 @@ public:
Q_INVOKABLE void forwardMessage(QString eventId, QString roomId);
Q_INVOKABLE void viewDecryptedRawMessage(QString id) const;
Q_INVOKABLE void openUserProfile(QString userid);
- Q_INVOKABLE void openRoomMembers();
+ Q_INVOKABLE void openRoomMembers(QString room_id = QString());
Q_INVOKABLE void openRoomSettings(QString room_id = QString());
Q_INVOKABLE void openInviteUsers(QString roomId = QString());
Q_INVOKABLE void editAction(QString id);
|