mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Add logging for libtgvoip when we have DebugLogs.
This commit is contained in:
parent
b3d5ac1660
commit
3b46382550
1 changed files with 12 additions and 0 deletions
|
@ -419,6 +419,18 @@ void Call::createAndStartController(const MTPDphoneCall &call) {
|
|||
config.enableAGC = true;
|
||||
config.init_timeout = Global::CallConnectTimeoutMs() / 1000;
|
||||
config.recv_timeout = Global::CallPacketTimeoutMs() / 1000;
|
||||
if (cDebug()) {
|
||||
auto callLogFolder = cWorkingDir() + qsl("DebugLogs");
|
||||
auto callLogPath = callLogFolder + qsl("/last_call_log.txt");
|
||||
auto callLogNative = QFile::encodeName(QDir::toNativeSeparators(callLogPath));
|
||||
auto callLogBytesSrc = gsl::as_bytes(gsl::make_span(callLogNative));
|
||||
auto callLogBytesDst = gsl::as_writeable_bytes(gsl::make_span(config.logFilePath));
|
||||
if (callLogBytesSrc.size() + 1 <= callLogBytesDst.size()) { // +1 - zero-terminator
|
||||
QFile(callLogPath).remove();
|
||||
QDir().mkpath(callLogFolder);
|
||||
base::copy_bytes(callLogBytesDst, callLogBytesSrc);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<Endpoint> endpoints;
|
||||
ConvertEndpoint(endpoints, call.vconnection.c_phoneConnection());
|
||||
|
|
Loading…
Add table
Reference in a new issue