2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Added usernames support to info profile.

This commit is contained in:
23rd
2022-10-13 01:24:03 +03:00
committed by John Preston
parent ad7bc6326d
commit 79f592a84f
9 changed files with 155 additions and 43 deletions

View File

@@ -109,13 +109,18 @@ void ChannelData::setUsername(const QString &username) {
}
void ChannelData::setUsernames(const Data::Usernames &usernames) {
_usernames = ranges::views::all(
auto newUsernames = ranges::views::all(
usernames
) | ranges::views::filter([&](const Data::Username &username) {
return username.active;
}) | ranges::views::transform([&](const Data::Username &username) {
return username.username;
}) | ranges::to_vector;
if (!ranges::equal(_usernames, newUsernames)) {
_usernames = std::move(newUsernames);
session().changes().peerUpdated(this, UpdateFlag::Usernames);
}
}
QString ChannelData::username() const {