mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Added support for sending state of low level of battery.
This commit is contained in:
parent
cb9adad660
commit
f135676d36
1 changed files with 10 additions and 0 deletions
|
@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "ui/boxes/confirm_box.h"
|
||||
#include "ui/boxes/rate_call_box.h"
|
||||
#include "calls/calls_instance.h"
|
||||
#include "base/battery_saving.h"
|
||||
#include "base/openssl_help.h"
|
||||
#include "base/random.h"
|
||||
#include "mtproto/mtproto_dh_utils.h"
|
||||
|
@ -1070,6 +1071,15 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
|||
_muted.value() | rpl::start_with_next([=](bool muted) {
|
||||
Core::App().mediaDevices().setCaptureMuted(muted);
|
||||
}, _instanceLifetime);
|
||||
|
||||
Core::App().batterySaving().value(
|
||||
) | rpl::start_with_next([=](bool isSaving) {
|
||||
crl::on_main(weak, [=] {
|
||||
if (_instance) {
|
||||
_instance->setIsLowBatteryLevel(isSaving);
|
||||
}
|
||||
});
|
||||
}, _instanceLifetime);
|
||||
}
|
||||
|
||||
void Call::handleControllerStateChange(tgcalls::State state) {
|
||||
|
|
Loading…
Add table
Reference in a new issue