diff --git a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp index ba3de328aa..0936bbc870 100644 --- a/Telegram/SourceFiles/history/view/history_view_contact_status.cpp +++ b/Telegram/SourceFiles/history/view/history_view_contact_status.cpp @@ -304,7 +304,8 @@ void ContactStatus::setupAddHandler(not_null user) { void ContactStatus::setupBlockHandler(not_null user) { _bar.entity()->blockClicks( ) | rpl::start_with_next([=] { - _window->show(Box(Window::PeerMenuBlockUserBox, _window, user)); + _window->show( + Box(Window::PeerMenuBlockUserBox, _window, user, true)); }, _bar.lifetime()); } diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 51cf0df90f..e212ff22ca 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -619,8 +619,11 @@ void ActionsFiller::addBlockAction(not_null user) { if (user->botInfo) { Ui::showPeerHistory(user, ShowAtUnreadMsgId); } - } else { + } else if (user->isBot()) { user->session().api().blockUser(user); + } else { + window->show( + Box(Window::PeerMenuBlockUserBox, window, user, false)); } }; AddActionButton( diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 781356d644..135681e9e1 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -154,7 +154,6 @@ void PhoneWidget::phoneSubmitDone(const MTPauth_SentCode &result) { fillSentCodeData(d); getData()->phone = _sentPhone; getData()->phoneHash = qba(d.vphone_code_hash()); - getData()->phoneIsRegistered = d.is_phone_registered(); const auto next = d.vnext_type(); if (next && next->type() == mtpc_auth_codeTypeCall) { getData()->callStatus = Widget::Data::CallStatus::Waiting; diff --git a/Telegram/SourceFiles/intro/introwidget.h b/Telegram/SourceFiles/intro/introwidget.h index 8b5badcdf8..e11aeb79ee 100644 --- a/Telegram/SourceFiles/intro/introwidget.h +++ b/Telegram/SourceFiles/intro/introwidget.h @@ -59,7 +59,6 @@ public: QString country; QString phone; QByteArray phoneHash; - bool phoneIsRegistered = false; enum class CallStatus { Waiting, diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index ecc7c62cc5..7e687014b2 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -348,7 +348,7 @@ void Filler::addBlockUser(not_null user) { } else if (user->isBot()) { user->session().api().blockUser(user); } else { - window->show(Box(PeerMenuBlockUserBox, window, user)); + window->show(Box(PeerMenuBlockUserBox, window, user, false)); } }); @@ -710,7 +710,8 @@ void PeerMenuCreatePoll(not_null peer) { void PeerMenuBlockUserBox( not_null box, not_null window, - not_null user) { + not_null user, + bool suggestClearChat) { using Flag = MTPDpeerSettings::Flag; const auto settings = user->settings().value_or(Flag(0)); @@ -738,13 +739,17 @@ void PeerMenuBlockUserBox( box->addSkip(st::boxMediumSkip); } - const auto clear = box->addRow(object_ptr( - box, - tr::lng_blocked_list_confirm_clear(tr::now), - true, - st::defaultBoxCheckbox)); + const auto clear = suggestClearChat + ? box->addRow(object_ptr( + box, + tr::lng_blocked_list_confirm_clear(tr::now), + true, + st::defaultBoxCheckbox)) + : nullptr; - box->addSkip(st::boxLittleSkip); + if (report || clear) { + box->addSkip(st::boxLittleSkip); + } box->setTitle(tr::lng_blocked_list_confirm_title( lt_name, @@ -752,7 +757,7 @@ void PeerMenuBlockUserBox( box->addButton(tr::lng_blocked_list_confirm_ok(), [=] { const auto reportChecked = report && report->checked(); - const auto clearChecked = clear->checked(); + const auto clearChecked = clear && clear->checked(); box->closeBox(); diff --git a/Telegram/SourceFiles/window/window_peer_menu.h b/Telegram/SourceFiles/window/window_peer_menu.h index ab79537c4c..a3c1fe0413 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.h +++ b/Telegram/SourceFiles/window/window_peer_menu.h @@ -56,7 +56,8 @@ void PeerMenuCreatePoll(not_null peer); void PeerMenuBlockUserBox( not_null box, not_null window, - not_null user); + not_null user, + bool suggestClearChat); void PeerMenuUnblockUserWithBotRestart(not_null user); void ToggleHistoryArchived(not_null history, bool archived);