mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 07:33:52 +02:00
Respect "call_requests_disabled" for confcalls.
This commit is contained in:
parent
4975a0a8d8
commit
ff67d876b2
3 changed files with 17 additions and 3 deletions
|
@ -18,6 +18,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "core/application.h"
|
||||
#include "core/core_settings.h"
|
||||
#include "main/session/session_show.h"
|
||||
#include "main/main_app_config.h"
|
||||
#include "main/main_session.h"
|
||||
#include "main/main_account.h"
|
||||
#include "apiwrap.h"
|
||||
|
@ -1090,7 +1091,8 @@ void Instance::showConferenceInvite(
|
|||
const auto video = call->video;
|
||||
if (!conferenceId
|
||||
|| call->state != Data::CallState::Invitation
|
||||
|| user->isSelf()) {
|
||||
|| user->isSelf()
|
||||
|| user->session().appConfig().callsDisabledForSession()) {
|
||||
return;
|
||||
} else if (_currentCall
|
||||
&& _currentCall->conferenceId() == conferenceId) {
|
||||
|
|
|
@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
*/
|
||||
#include "main/main_app_config.h"
|
||||
|
||||
#include "api/api_authorizations.h"
|
||||
#include "apiwrap.h"
|
||||
#include "base/call_delayed.h"
|
||||
#include "main/main_account.h"
|
||||
|
@ -108,6 +109,15 @@ int AppConfig::pinnedGiftsLimit() const {
|
|||
return get<int>(u"stargifts_pinned_to_top_limit"_q, 6);
|
||||
}
|
||||
|
||||
bool AppConfig::callsDisabledForSession() const {
|
||||
const auto authorizations = _account->sessionExists()
|
||||
? &_account->session().api().authorizations()
|
||||
: nullptr;
|
||||
return get<bool>(
|
||||
u"call_requests_disabled"_q,
|
||||
authorizations->callsDisabledHere());
|
||||
}
|
||||
|
||||
int AppConfig::confcallSizeLimit() const {
|
||||
return get<int>(
|
||||
u"conference_call_size_limit"_q,
|
||||
|
@ -314,8 +324,9 @@ bool AppConfig::suggestionCurrent(const QString &key) const {
|
|||
if (_dismissedSuggestions.contains(key)) {
|
||||
return false;
|
||||
} else {
|
||||
const auto known
|
||||
= _account->session().data().knownContactBirthdays();
|
||||
const auto known = _account->sessionExists()
|
||||
? _account->session().data().knownContactBirthdays()
|
||||
: std::vector<UserId>();
|
||||
if (!known) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -79,6 +79,7 @@ public:
|
|||
|
||||
[[nodiscard]] int pinnedGiftsLimit() const;
|
||||
|
||||
[[nodiscard]] bool callsDisabledForSession() const;
|
||||
[[nodiscard]] int confcallSizeLimit() const;
|
||||
[[nodiscard]] bool confcallPrioritizeVP8() const;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue