From b1c1274d96144805bf416571117f9889f2e55600 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 13 Nov 2021 15:05:26 -0500 Subject: Allow removing users from the invite dialog --- src/InviteesModel.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/InviteesModel.cpp') diff --git a/src/InviteesModel.cpp b/src/InviteesModel.cpp index e045581a..707bfd97 100644 --- a/src/InviteesModel.cpp +++ b/src/InviteesModel.cpp @@ -30,6 +30,20 @@ InviteesModel::addUser(QString mxid) emit countChanged(); } +void +InviteesModel::removeUser(QString mxid) +{ + for (int i = 0; i < invitees_.length(); ++i) { + if (invitees_[i]->mxid_ == mxid) { + beginRemoveRows(QModelIndex(), i, i); + invitees_.removeAt(i); + endRemoveRows(); + emit countChanged(); + break; + } + } +} + QHash InviteesModel::roleNames() const { -- cgit 1.5.1