mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 15:05:56 +00:00
Move some code around.
Move logs:SignalHandlers to core/crash_reports:CrashReports. Move all pre-launch windows to core/crash_report_window module. Move some global code to core/launcher:Launcher. It should replace settings / platform_specific module in some way.
This commit is contained in:
@@ -23,9 +23,22 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
|
||||
#include "mtproto/connection.h"
|
||||
#include "mtproto/dcenter.h"
|
||||
#include "mtproto/auth_key.h"
|
||||
#include "core/crash_reports.h"
|
||||
|
||||
namespace MTP {
|
||||
namespace internal {
|
||||
namespace {
|
||||
|
||||
QString LogIds(const QVector<uint64> &ids) {
|
||||
if (!ids.size()) return "[]";
|
||||
auto idsStr = QString("[%1").arg(*ids.cbegin());
|
||||
for (const auto id : ids) {
|
||||
idsStr += QString(", %2").arg(id);
|
||||
}
|
||||
return idsStr + "]";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
void SessionData::setKey(const AuthKeyPtr &key) {
|
||||
if (_authKey != key) {
|
||||
@@ -140,6 +153,23 @@ bool Session::rpcErrorOccured(mtpRequestId requestId, const RPCFailHandlerPtr &o
|
||||
return _instance->rpcErrorOccured(requestId, onFail, err);
|
||||
}
|
||||
|
||||
void Session::requestPrepareFailed(
|
||||
const RPCFailHandlerPtr &onFail,
|
||||
Exception &e) {
|
||||
CrashReports::SetAnnotation("RequestException", QString::fromLatin1(e.what()));
|
||||
Unexpected("Exception in Session::send()");
|
||||
|
||||
const auto requestId = 0;
|
||||
const auto error = rpcClientError(
|
||||
"NO_REQUEST_ID",
|
||||
QString(
|
||||
"send() failed to queue request, exception: %1"
|
||||
).arg(
|
||||
e.what()
|
||||
));
|
||||
rpcErrorOccured(requestId, onFail, error);
|
||||
}
|
||||
|
||||
void Session::restart() {
|
||||
if (_killed) {
|
||||
DEBUG_LOG(("Session Error: can't restart a killed session"));
|
||||
@@ -271,7 +301,7 @@ void Session::checkRequestsByTimer() {
|
||||
}
|
||||
|
||||
if (stateRequestIds.size()) {
|
||||
DEBUG_LOG(("MTP Info: requesting state of msgs: %1").arg(Logs::vector(stateRequestIds)));
|
||||
DEBUG_LOG(("MTP Info: requesting state of msgs: %1").arg(LogIds(stateRequestIds)));
|
||||
{
|
||||
QWriteLocker locker(data.stateRequestMutex());
|
||||
for (uint32 i = 0, l = stateRequestIds.size(); i < l; ++i) {
|
||||
|
Reference in New Issue
Block a user