Don't add a user twice

This commit is contained in:
Loren Burkholder 2021-11-13 15:05:37 -05:00
parent b1c1274d96
commit 8830ce25d1

View file

@ -16,6 +16,10 @@ InviteesModel::InviteesModel(QObject *parent)
void void
InviteesModel::addUser(QString mxid) InviteesModel::addUser(QString mxid)
{ {
for (const auto &invitee : invitees_)
if (invitee->mxid_ == mxid)
return;
beginInsertRows(QModelIndex(), invitees_.count(), invitees_.count()); beginInsertRows(QModelIndex(), invitees_.count(), invitees_.count());
auto invitee = new Invitee{mxid, this}; auto invitee = new Invitee{mxid, this};