mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Add call peer-to-peer setting in Privacy&Security.
This commit is contained in:
@@ -572,7 +572,20 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
||||
_controller->SetMicMute(_mute);
|
||||
}
|
||||
_controller->implData = static_cast<void*>(this);
|
||||
_controller->SetRemoteEndpoints(endpoints, true, protocol.vmax_layer.v);
|
||||
const auto p2p = [&] {
|
||||
switch (Auth().settings().callsPeerToPeer()) {
|
||||
case PeerToPeer::DefaultContacts:
|
||||
case PeerToPeer::Contacts:
|
||||
return _user->isContact();
|
||||
case PeerToPeer::DefaultEveryone:
|
||||
case PeerToPeer::Everyone:
|
||||
return true;
|
||||
case PeerToPeer::Nobody:
|
||||
return false;
|
||||
}
|
||||
Unexpected("Calls::PeerToPeer value in Auth().settings().");
|
||||
}();
|
||||
_controller->SetRemoteEndpoints(endpoints, p2p, protocol.vmax_layer.v);
|
||||
_controller->SetConfig(config);
|
||||
_controller->SetEncryptionKey(reinterpret_cast<char*>(_authKey.data()), (_type == Type::Outgoing));
|
||||
_controller->SetCallbacks(callbacks);
|
||||
|
Reference in New Issue
Block a user