mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Add to Group / Channel with suggested rights for bots.
This commit is contained in:
@@ -239,6 +239,25 @@ void ApplyUserUpdate(not_null<UserData*> user, const MTPDuserFull &update) {
|
||||
user->setCommonChatsCount(update.vcommon_chats_count().v);
|
||||
user->checkFolder(update.vfolder_id().value_or_empty());
|
||||
user->setThemeEmoji(qs(update.vtheme_emoticon().value_or_empty()));
|
||||
|
||||
if (const auto info = user->botInfo.get()) {
|
||||
const auto group = update.vbot_group_admin_rights()
|
||||
? ChatAdminRightsInfo(*update.vbot_group_admin_rights()).flags
|
||||
: ChatAdminRights();
|
||||
const auto channel = update.vbot_broadcast_admin_rights()
|
||||
? ChatAdminRightsInfo(
|
||||
*update.vbot_broadcast_admin_rights()).flags
|
||||
: ChatAdminRights();
|
||||
if (info->groupAdminRights != group
|
||||
|| info->channelAdminRights != channel) {
|
||||
info->groupAdminRights = group;
|
||||
info->channelAdminRights = channel;
|
||||
user->session().changes().peerUpdated(
|
||||
user,
|
||||
Data::PeerUpdate::Flag::Rights);
|
||||
}
|
||||
}
|
||||
|
||||
user->fullUpdated();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user