Skip to content
Snippets Groups Projects
Verified Commit 3357dc21 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Skip users we don't share a room with in invite dialog

Fixes #1757
parent 311d9ad3
No related branches found
No related tags found
No related merge requests found
......@@ -25,10 +25,13 @@ UsersModel::UsersModel(const std::string &roomId, QObject *parent)
std::get_if<mtx::events::AccountDataEvent<mtx::events::account_data::Direct>>(
&e.value())) {
for (const auto &[userId, roomIds] : event->content.user_to_rooms) {
if (roomIds.empty())
continue;
displayNames.push_back(
QString::fromStdString(cache::displayName(roomIds[0], userId)));
QString::fromStdString(cache::displayName(roomIds.at(0), userId)));
userids.push_back(QString::fromStdString(userId));
avatarUrls.push_back(cache::avatarUrl(QString::fromStdString(roomIds[0]),
avatarUrls.push_back(cache::avatarUrl(QString::fromStdString(roomIds.at(0)),
QString::fromStdString(userId)));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment