2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Add call peer-to-peer setting in Privacy&Security.

This commit is contained in:
John Preston
2018-09-12 20:02:30 +03:00
parent 673fea47bd
commit c4ca180745
10 changed files with 206 additions and 15 deletions

View File

@@ -16,6 +16,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "mtproto/sender.h"
#include "mtproto/rsa_public_key.h"
#include "storage/localstorage.h"
#include "calls/calls_instance.h"
#include "auth_session.h"
#include "application.h"
#include "apiwrap.h"
@@ -782,6 +783,18 @@ void Instance::Private::configLoadDone(const MTPConfig &result) {
+ (data.vexpires.v - unixtime()) * TimeMs(1000);
requestConfigIfExpired();
if (AuthSession::Exists()) {
using PeerToPeer = Calls::PeerToPeer;
const auto current = Auth().settings().callsPeerToPeer();
if (current == PeerToPeer::DefaultContacts
|| current == PeerToPeer::DefaultEveryone) {
Auth().settings().setCallsPeerToPeer(
(data.is_default_p2p_contacts()
? PeerToPeer::DefaultContacts
: PeerToPeer::DefaultEveryone));
}
}
emit _instance->configLoaded();
}