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

Restart instead of Unblock for bots.

This commit is contained in:
John Preston
2018-12-04 15:46:07 +04:00
parent 6562a1f6af
commit 61add763ae
9 changed files with 84 additions and 95 deletions

View File

@@ -574,7 +574,7 @@ void ActionsFiller::addBlockAction(not_null<UserData*> user) {
switch (user->blockStatus()) {
case UserData::BlockStatus::Blocked:
return Lang::Viewer(user->botInfo
? lng_profile_unblock_bot
? lng_profile_restart_bot
: lng_profile_unblock_user);
case UserData::BlockStatus::NotBlocked:
default:
@@ -590,9 +590,12 @@ void ActionsFiller::addBlockAction(not_null<UserData*> user) {
) | rpl::map([](const QString &text) {
return !text.isEmpty();
});
auto callback = [user] {
auto callback = [=] {
if (user->isBlocked()) {
Auth().api().unblockUser(user);
if (user->botInfo) {
Ui::showPeerHistory(user, ShowAtUnreadMsgId);
}
} else {
Auth().api().blockUser(user);
}