mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 22:55:11 +00:00
Added support for sending state of low level of battery.
This commit is contained in:
@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "ui/boxes/confirm_box.h"
|
#include "ui/boxes/confirm_box.h"
|
||||||
#include "ui/boxes/rate_call_box.h"
|
#include "ui/boxes/rate_call_box.h"
|
||||||
#include "calls/calls_instance.h"
|
#include "calls/calls_instance.h"
|
||||||
|
#include "base/battery_saving.h"
|
||||||
#include "base/openssl_help.h"
|
#include "base/openssl_help.h"
|
||||||
#include "base/random.h"
|
#include "base/random.h"
|
||||||
#include "mtproto/mtproto_dh_utils.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) {
|
_muted.value() | rpl::start_with_next([=](bool muted) {
|
||||||
Core::App().mediaDevices().setCaptureMuted(muted);
|
Core::App().mediaDevices().setCaptureMuted(muted);
|
||||||
}, _instanceLifetime);
|
}, _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) {
|
void Call::handleControllerStateChange(tgcalls::State state) {
|
||||||
|
Reference in New Issue
Block a user