|
|
@ -238,7 +238,7 @@ struct temptree |
|
|
|
void flatten(CommunitiesModel::FlatTree &to, int i = 0) const |
|
|
|
void flatten(CommunitiesModel::FlatTree &to, int i = 0) const |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (const auto &[child, subtree] : children) { |
|
|
|
for (const auto &[child, subtree] : children) { |
|
|
|
to.tree.push_back({QString::fromStdString(child), i, false}); |
|
|
|
to.tree.push_back({QString::fromStdString(child), i, {}, false}); |
|
|
|
subtree.flatten(to, i + 1); |
|
|
|
subtree.flatten(to, i + 1); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -275,15 +275,17 @@ CommunitiesModel::initializeSidebar() |
|
|
|
globalUnreads.notification_count = {}; |
|
|
|
globalUnreads.notification_count = {}; |
|
|
|
dmUnreads.notification_count = {}; |
|
|
|
dmUnreads.notification_count = {}; |
|
|
|
|
|
|
|
|
|
|
|
auto e = cache::client()->getAccountData(mtx::events::EventType::Direct); |
|
|
|
{ |
|
|
|
if (e) { |
|
|
|
auto e = cache::client()->getAccountData(mtx::events::EventType::Direct); |
|
|
|
if (auto event = |
|
|
|
if (e) { |
|
|
|
std::get_if<mtx::events::AccountDataEvent<mtx::events::account_data::Direct>>( |
|
|
|
if (auto event = |
|
|
|
&e.value())) { |
|
|
|
std::get_if<mtx::events::AccountDataEvent<mtx::events::account_data::Direct>>( |
|
|
|
directMessages_.clear(); |
|
|
|
&e.value())) { |
|
|
|
for (const auto &[userId, roomIds] : event->content.user_to_rooms) |
|
|
|
directMessages_.clear(); |
|
|
|
for (const auto &roomId : roomIds) |
|
|
|
for (const auto &[userId, roomIds] : event->content.user_to_rooms) |
|
|
|
directMessages_.push_back(roomId); |
|
|
|
for (const auto &roomId : roomIds) |
|
|
|
|
|
|
|
directMessages_.push_back(roomId); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|