2
0
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:
John Preston
2019-07-04 16:02:22 +02:00
parent 0e964b06dc
commit 9d09cee1cc
8 changed files with 46 additions and 40 deletions

View File

@@ -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) {