2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 23:45:44 +00:00

MTP global state moved to MTP::Instance class.

Now there will be ability to start multiple mtproto instances.
This commit is contained in:
John Preston
2017-02-24 20:15:41 +03:00
parent c3b3819d9f
commit dd933cf61c
23 changed files with 1868 additions and 1341 deletions

View File

@@ -25,6 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include <new>
#include "pspecific.h"
#include "mtproto/connection.h"
#ifndef TDESKTOP_DISABLE_CRASH_REPORTS
@@ -87,9 +88,8 @@ QString _logsEntryStart() {
static int32 index = 0;
QDateTime tm(QDateTime::currentDateTime());
QThread *thread = QThread::currentThread();
MTP::internal::Thread *mtpThread = qobject_cast<MTP::internal::Thread*>(thread);
uint threadId = mtpThread ? mtpThread->getThreadId() : 0;
auto thread = qobject_cast<MTP::internal::Thread*>(QThread::currentThread());
auto threadId = thread ? thread->getThreadIndex() : 0;
return QString("[%1 %2-%3]").arg(tm.toString("hh:mm:ss.zzz")).arg(QString("%1").arg(threadId, 2, 10, QChar('0'))).arg(++index, 7, 10, QChar('0'));
}