mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 15:15:13 +00:00
Allow creating approve-only invite links.
This commit is contained in:
@@ -146,6 +146,9 @@ void ChatData::setAdminRights(ChatAdminRights rights) {
|
||||
return;
|
||||
}
|
||||
_adminRights.set(rights);
|
||||
if (!canHaveInviteLink()) {
|
||||
setPendingRequestsCount(0);
|
||||
}
|
||||
session().changes().peerUpdated(
|
||||
this,
|
||||
UpdateFlag::Rights | UpdateFlag::Admins | UpdateFlag::BannedUsers);
|
||||
@@ -258,6 +261,13 @@ void ChatData::setBotCommands(
|
||||
}
|
||||
}
|
||||
|
||||
void ChatData::setPendingRequestsCount(int count) {
|
||||
if (_pendingRequestsCount != count) {
|
||||
_pendingRequestsCount = count;
|
||||
session().changes().peerUpdated(this, UpdateFlag::PendingRequests);
|
||||
}
|
||||
}
|
||||
|
||||
namespace Data {
|
||||
|
||||
void ApplyChatUpdate(
|
||||
@@ -431,6 +441,8 @@ void ApplyChatUpdate(not_null<ChatData*> chat, const MTPDchatFull &update) {
|
||||
chat->setThemeEmoji(qs(update.vtheme_emoticon().value_or_empty()));
|
||||
chat->fullUpdated();
|
||||
chat->setAbout(qs(update.vabout()));
|
||||
chat->setPendingRequestsCount(
|
||||
update.vrequests_pending().value_or_empty());
|
||||
|
||||
chat->session().api().applyNotifySettings(
|
||||
MTP_inputNotifyPeer(chat->input),
|
||||
|
Reference in New Issue
Block a user