Removed mute toggle from profile section.

This commit is contained in:
23rd
2025-10-21 12:55:58 +03:00
parent 38ab18f6fb
commit 1905a67e6c
2 changed files with 0 additions and 81 deletions
@@ -1162,7 +1162,6 @@ public:
private:
object_ptr<Ui::RpWidget> setupPersonalChannel(not_null<UserData*> user);
object_ptr<Ui::RpWidget> setupInfo();
object_ptr<Ui::RpWidget> setupMuteToggle();
void setupMainApp();
void setupBotPermissions();
void setupMainButtons();
@@ -1727,29 +1726,6 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
addTranslateToMenu(about.text, AboutWithAdvancedValue(_peer));
}
}
if (!_peer->isSelf()) {
// No notifications toggle for Self => no separator.
const auto user = _peer->asUser();
const auto app = user && user->botInfo && user->botInfo->hasMainApp;
const auto padding = app
? QMargins(
st::infoOpenAppMargin.left(),
st::infoProfileSeparatorPadding.top(),
st::infoOpenAppMargin.right(),
0)
: st::infoProfileSeparatorPadding;
result->add(object_ptr<Ui::SlideWrap<>>(
result,
object_ptr<Ui::PlainShadow>(result),
padding)
)->setDuration(
st::infoSlideDuration
)->toggleOn(
std::move(tracker).atLeastOneShownValue()
);
}
object_ptr<FloatingIcon>(
result,
st::infoIconInformation,
@@ -2038,57 +2014,6 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupPersonalChannel(
return result;
}
object_ptr<Ui::RpWidget> DetailsFiller::setupMuteToggle() {
const auto peer = _peer;
const auto topicRootId = _topic ? _topic->rootId() : MsgId();
const auto makeThread = [=] {
return topicRootId
? static_cast<Data::Thread*>(peer->forumTopicFor(topicRootId))
: peer->owner().history(peer).get();
};
auto result = object_ptr<Ui::SettingsButton>(
_wrap,
tr::lng_profile_enable_notifications(),
st::infoNotificationsButton);
result->toggleOn(_topic
? NotificationsEnabledValue(_topic)
: NotificationsEnabledValue(peer), true);
result->setAcceptBoth();
const auto notifySettings = &peer->owner().notifySettings();
MuteMenu::SetupMuteMenu(
result.data(),
result->clicks(
) | rpl::filter([=](Qt::MouseButton button) {
if (button == Qt::RightButton) {
return true;
}
const auto topic = topicRootId
? peer->forumTopicFor(topicRootId)
: nullptr;
Assert(!topicRootId || topic != nullptr);
const auto is = topic
? notifySettings->isMuted(topic)
: notifySettings->isMuted(peer);
if (is) {
if (topic) {
notifySettings->update(topic, { .unmute = true });
} else {
notifySettings->update(peer, { .unmute = true });
}
return false;
} else {
return true;
}
}) | rpl::to_empty,
makeThread,
_controller->uiShow());
object_ptr<FloatingIcon>(
result,
st::infoIconNotifications,
st::infoNotificationsIconPosition);
return result;
}
void DetailsFiller::setupMainApp() {
const auto button = _wrap->add(
object_ptr<Ui::RoundButton>(
@@ -2410,9 +2335,6 @@ object_ptr<Ui::RpWidget> DetailsFiller::fill() {
}
}
}
if (!_sublist && !_peer->isSelf()) {
add(setupMuteToggle());
}
setupMainButtons();
add(CreateSkipWidget(_wrap));