mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Unblock bots without restarting from Settings.
This commit is contained in:
@@ -344,7 +344,7 @@ void Filler::addBlockUser(not_null<UserData*> user) {
|
||||
};
|
||||
const auto blockAction = _addAction(blockText(user), [=] {
|
||||
if (user->isBlocked()) {
|
||||
user->session().api().unblockUser(user);
|
||||
PeerMenuUnblockUserWithBotRestart(user);
|
||||
} else if (user->isBot()) {
|
||||
user->session().api().blockUser(user);
|
||||
} else {
|
||||
@@ -778,6 +778,14 @@ void PeerMenuBlockUserBox(
|
||||
});
|
||||
}
|
||||
|
||||
void PeerMenuUnblockUserWithBotRestart(not_null<UserData*> user) {
|
||||
user->session().api().unblockUser(user, [=] {
|
||||
if (user->isBot() && !user->isSupport()) {
|
||||
user->session().api().sendBotStart(user);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
QPointer<Ui::RpWidget> ShowForwardMessagesBox(
|
||||
MessageIdsList &&items,
|
||||
FnMut<void()> &&successCallback) {
|
||||
|
Reference in New Issue
Block a user