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

Add members list to info profile.

This commit is contained in:
John Preston
2017-09-25 19:06:53 +03:00
parent faeb1483f2
commit f2a5862714
34 changed files with 943 additions and 300 deletions

View File

@@ -961,23 +961,28 @@ namespace {
}
void feedChatAdmins(const MTPDupdateChatAdmins &d) {
ChatData *chat = App::chat(d.vchat_id.v);
auto chat = App::chat(d.vchat_id.v);
if (chat->version <= d.vversion.v) {
bool badVersion = (chat->version + 1 < d.vversion.v);
if (badVersion) {
chat->invalidateParticipants();
Auth().api().requestPeer(chat);
}
auto wasCanEdit = chat->canEdit();
auto badVersion = (chat->version + 1 < d.vversion.v);
chat->version = d.vversion.v;
if (mtpIsTrue(d.venabled)) {
if (!badVersion) {
chat->invalidateParticipants();
}
chat->flags |= MTPDchat::Flag::f_admins_enabled;
} else {
chat->flags &= ~MTPDchat::Flag::f_admins_enabled;
}
Notify::peerUpdatedDelayed(chat, Notify::PeerUpdate::Flag::AdminsChanged);
if (badVersion || mtpIsTrue(d.venabled)) {
chat->invalidateParticipants();
Auth().api().requestPeer(chat);
}
if (wasCanEdit != chat->canEdit()) {
Notify::peerUpdatedDelayed(
chat,
Notify::PeerUpdate::Flag::ChatCanEdit);
}
Notify::peerUpdatedDelayed(
chat,
Notify::PeerUpdate::Flag::AdminsChanged);
}
}