summary refs log tree commit diff
path: root/src/InviteesModel.cpp
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-11-13 15:05:26 -0500
committerLoren Burkholder <computersemiexpert@outlook.com>2021-11-16 18:40:48 -0500
commitb1c1274d96144805bf416571117f9889f2e55600 (patch)
tree386eebaa22102e11f4015ee200f8dfebc49e5afc /src/InviteesModel.cpp
parentNicer padding (diff)
downloadnheko-b1c1274d96144805bf416571117f9889f2e55600.tar.xz
Allow removing users from the invite dialog
Diffstat (limited to 'src/InviteesModel.cpp')
-rw-r--r--src/InviteesModel.cpp14
1 files changed, 14 insertions, 0 deletions
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<int, QByteArray>
 InviteesModel::roleNames() const
 {