mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Revert "Move Blocked users to Privacy in Settings."
This reverts commit 1acfe441e1
.
This commit is contained in:
parent
5d5e4cbdff
commit
eebe1f4c11
2 changed files with 21 additions and 34 deletions
|
@ -397,11 +397,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||||
tr::lng_info_mobile_label(),
|
tr::lng_info_mobile_label(),
|
||||||
PhoneOrHiddenValue(user),
|
PhoneOrHiddenValue(user),
|
||||||
tr::lng_profile_copy_phone(tr::now)).text;
|
tr::lng_profile_copy_phone(tr::now)).text;
|
||||||
using namespace Ui;
|
const auto hook = [=](Ui::FlatLabel::ContextMenuRequest request) {
|
||||||
const auto hook = [=](FlatLabel::ContextMenuRequest request) {
|
|
||||||
if (user->phone().isEmpty()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
phoneLabel->fillContextMenu(request);
|
phoneLabel->fillContextMenu(request);
|
||||||
AddPhoneMenu(request.menu, user);
|
AddPhoneMenu(request.menu, user);
|
||||||
};
|
};
|
||||||
|
|
|
@ -246,28 +246,15 @@ rpl::producer<int> BlockedPeersCount(not_null<::Main::Session*> session) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupBlockedList(
|
|
||||||
not_null<Window::SessionController*> controller,
|
|
||||||
not_null<Ui::VerticalLayout*> container,
|
|
||||||
rpl::producer<> updateTrigger,
|
|
||||||
Fn<void(Type)> showOther);
|
|
||||||
|
|
||||||
void SetupPrivacy(
|
void SetupPrivacy(
|
||||||
not_null<Window::SessionController*> controller,
|
not_null<Window::SessionController*> controller,
|
||||||
not_null<Ui::VerticalLayout*> container,
|
not_null<Ui::VerticalLayout*> container,
|
||||||
rpl::producer<> updateTrigger,
|
rpl::producer<> updateTrigger) {
|
||||||
Fn<void(Type)> showOther) {
|
|
||||||
AddSkip(container, st::settingsPrivacySkip);
|
AddSkip(container, st::settingsPrivacySkip);
|
||||||
AddSubsectionTitle(container, tr::lng_settings_privacy_title());
|
AddSubsectionTitle(container, tr::lng_settings_privacy_title());
|
||||||
|
|
||||||
const auto session = &controller->session();
|
const auto session = &controller->session();
|
||||||
|
|
||||||
SetupBlockedList(
|
|
||||||
controller,
|
|
||||||
container,
|
|
||||||
rpl::duplicate(updateTrigger),
|
|
||||||
showOther);
|
|
||||||
|
|
||||||
using Key = Privacy::Key;
|
using Key = Privacy::Key;
|
||||||
const auto add = [&](
|
const auto add = [&](
|
||||||
rpl::producer<QString> label,
|
rpl::producer<QString> label,
|
||||||
|
@ -293,27 +280,22 @@ void SetupPrivacy(
|
||||||
{ &st::settingsIconOnline, kIconLightBlue },
|
{ &st::settingsIconOnline, kIconLightBlue },
|
||||||
Key::LastSeen,
|
Key::LastSeen,
|
||||||
[=] { return std::make_unique<LastSeenPrivacyController>(session); });
|
[=] { return std::make_unique<LastSeenPrivacyController>(session); });
|
||||||
add(
|
|
||||||
tr::lng_settings_profile_photo_privacy(),
|
|
||||||
{ &st::settingsIconAccount, kIconRed },
|
|
||||||
Key::ProfilePhoto,
|
|
||||||
[] { return std::make_unique<ProfilePhotoPrivacyController>(); });
|
|
||||||
add(
|
add(
|
||||||
tr::lng_settings_forwards_privacy(),
|
tr::lng_settings_forwards_privacy(),
|
||||||
{ &st::settingsIconForward, kIconLightOrange },
|
{ &st::settingsIconForward, kIconLightOrange },
|
||||||
Key::Forwards,
|
Key::Forwards,
|
||||||
[=] { return std::make_unique<ForwardsPrivacyController>(
|
[=] { return std::make_unique<ForwardsPrivacyController>(
|
||||||
controller); });
|
controller); });
|
||||||
|
add(
|
||||||
|
tr::lng_settings_profile_photo_privacy(),
|
||||||
|
{ &st::settingsIconAccount, kIconRed },
|
||||||
|
Key::ProfilePhoto,
|
||||||
|
[] { return std::make_unique<ProfilePhotoPrivacyController>(); });
|
||||||
add(
|
add(
|
||||||
tr::lng_settings_calls(),
|
tr::lng_settings_calls(),
|
||||||
{ &st::settingsIconVideoCalls, kIconGreen },
|
{ &st::settingsIconVideoCalls, kIconGreen },
|
||||||
Key::Calls,
|
Key::Calls,
|
||||||
[] { return std::make_unique<CallsPrivacyController>(); });
|
[] { return std::make_unique<CallsPrivacyController>(); });
|
||||||
add(
|
|
||||||
tr::lng_settings_groups_invite(),
|
|
||||||
{ &st::settingsIconGroup, kIconDarkBlue },
|
|
||||||
Key::Invites,
|
|
||||||
[] { return std::make_unique<GroupsInvitePrivacyController>(); });
|
|
||||||
AddPremiumPrivacyButton(
|
AddPremiumPrivacyButton(
|
||||||
controller,
|
controller,
|
||||||
container,
|
container,
|
||||||
|
@ -321,11 +303,16 @@ void SetupPrivacy(
|
||||||
{ &st::settingsPremiumIconVoice, kIconRed },
|
{ &st::settingsPremiumIconVoice, kIconRed },
|
||||||
Key::Voices,
|
Key::Voices,
|
||||||
[=] { return std::make_unique<VoicesPrivacyController>(session); });
|
[=] { return std::make_unique<VoicesPrivacyController>(session); });
|
||||||
|
add(
|
||||||
|
tr::lng_settings_groups_invite(),
|
||||||
|
{ &st::settingsIconGroup, kIconDarkBlue },
|
||||||
|
Key::Invites,
|
||||||
|
[] { return std::make_unique<GroupsInvitePrivacyController>(); });
|
||||||
|
|
||||||
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
|
session->api().userPrivacy().reload(Api::UserPrivacy::Key::AddedByPhone);
|
||||||
|
|
||||||
AddSkip(container, st::settingsPrivacySecurityPadding);
|
AddSkip(container, st::settingsPrivacySecurityPadding);
|
||||||
AddDivider(container);
|
AddDividerText(container, tr::lng_settings_group_privacy_about());
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetupArchiveAndMute(
|
void SetupArchiveAndMute(
|
||||||
|
@ -721,6 +708,11 @@ void SetupSecurity(
|
||||||
AddSkip(container, st::settingsPrivacySkip);
|
AddSkip(container, st::settingsPrivacySkip);
|
||||||
AddSubsectionTitle(container, tr::lng_settings_security());
|
AddSubsectionTitle(container, tr::lng_settings_security());
|
||||||
|
|
||||||
|
SetupBlockedList(
|
||||||
|
controller,
|
||||||
|
container,
|
||||||
|
rpl::duplicate(updateTrigger),
|
||||||
|
showOther);
|
||||||
SetupSessionsList(
|
SetupSessionsList(
|
||||||
controller,
|
controller,
|
||||||
container,
|
container,
|
||||||
|
@ -873,11 +865,10 @@ void PrivacySecurity::setupContent(
|
||||||
return rpl::duplicate(updateOnTick);
|
return rpl::duplicate(updateOnTick);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto showOther = [=](Type type) {
|
SetupPrivacy(controller, content, trigger());
|
||||||
|
SetupSecurity(controller, content, trigger(), [=](Type type) {
|
||||||
_showOther.fire_copy(type);
|
_showOther.fire_copy(type);
|
||||||
};
|
});
|
||||||
SetupPrivacy(controller, content, trigger(), showOther);
|
|
||||||
SetupSecurity(controller, content, trigger(), showOther);
|
|
||||||
#if !defined OS_MAC_STORE && !defined OS_WIN_STORE
|
#if !defined OS_MAC_STORE && !defined OS_WIN_STORE
|
||||||
SetupSensitiveContent(controller, content, trigger());
|
SetupSensitiveContent(controller, content, trigger());
|
||||||
#else // !OS_MAC_STORE && !OS_WIN_STORE
|
#else // !OS_MAC_STORE && !OS_WIN_STORE
|
||||||
|
|
Loading…
Add table
Reference in a new issue