Don't check config.phonecalls_enabled value.

This commit is contained in:
John Preston 2022-02-09 14:59:13 +03:00
parent f57d21eaeb
commit 1501a6d8fc
5 changed files with 4 additions and 17 deletions

View file

@ -177,11 +177,6 @@ TopBarWidget::TopBarWidget(
}
}, lifetime());
session().serverConfig().phoneCallsEnabled.changes(
) | rpl::start_with_next([=] {
updateControlsVisibility();
}, lifetime());
rpl::combine(
Core::App().settings().thirdSectionInfoEnabledValue(),
Core::App().settings().tabbedReplacedWithInfoValue()

View file

@ -430,9 +430,7 @@ void WrapWidget::addProfileCallsButton() {
const auto peer = key().peer();
const auto user = peer ? peer->asUser() : nullptr;
if (!user
|| user->sharedMediaInfo()
|| !user->session().serverConfig().phoneCallsEnabled.current()) {
if (!user || user->sharedMediaInfo()) {
return;
}

View file

@ -75,7 +75,7 @@ QByteArray Config::serialize() const {
<< qint32(_fields.callPacketTimeoutMs)
<< qint32(_fields.webFileDcId)
<< _fields.txtDomainString
<< qint32(_fields.phoneCallsEnabled.current() ? 1 : 0)
<< qint32(1) // legacy phoneCallsEnabled
<< qint32(_fields.blockedMode ? 1 : 0)
<< qint32(_fields.captionLengthMax);
}
@ -109,6 +109,7 @@ std::unique_ptr<Config> Config::FromSerialized(const QByteArray &serialized) {
}
auto dcOptionsSerialized = QByteArray();
auto legacyPhoneCallsEnabled = rpl::variable<bool>();
const auto read = [&](auto &field) {
using Type = std::remove_reference_t<decltype(field)>;
if constexpr (std::is_same_v<Type, int>
@ -157,7 +158,7 @@ std::unique_ptr<Config> Config::FromSerialized(const QByteArray &serialized) {
read(raw->_fields.callPacketTimeoutMs);
read(raw->_fields.webFileDcId);
read(raw->_fields.txtDomainString);
read(raw->_fields.phoneCallsEnabled);
read(legacyPhoneCallsEnabled);
read(raw->_fields.blockedMode);
read(raw->_fields.captionLengthMax);
@ -217,7 +218,6 @@ void Config::apply(const MTPDconfig &data) {
_fields.callRingTimeoutMs = data.vcall_ring_timeout_ms().v;
_fields.callConnectTimeoutMs = data.vcall_connect_timeout_ms().v;
_fields.callPacketTimeoutMs = data.vcall_packet_timeout_ms().v;
_fields.phoneCallsEnabled = data.is_phonecalls_enabled();
_fields.blockedMode = data.is_blocked_mode();
_fields.captionLengthMax = data.vcaption_length_max().v;

View file

@ -39,7 +39,6 @@ struct ConfigFields {
int callPacketTimeoutMs = 10000;
int webFileDcId = 4;
QString txtDomainString;
rpl::variable<bool> phoneCallsEnabled = true;
bool blockedMode = false;
int captionLengthMax = 1024;
};

View file

@ -678,11 +678,6 @@ MainMenu::MainMenu(
updatePhone();
}, lifetime());
_controller->session().serverConfig().phoneCallsEnabled.changes(
) | rpl::start_with_next([=] {
refreshMenu();
}, lifetime());
using Window::Theme::BackgroundUpdate;
Window::Theme::Background()->updates(
) | rpl::start_with_next([=](const BackgroundUpdate &update) {