mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Move some modules to lib_mtproto.
This commit is contained in:
@@ -8,7 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#pragma once
|
||||
|
||||
#include "core/core_settings.h"
|
||||
#include "mtproto/auth_key.h"
|
||||
#include "mtproto/mtproto_auth_key.h"
|
||||
#include "mtproto/mtproto_proxy_data.h"
|
||||
#include "base/observer.h"
|
||||
#include "base/timer.h"
|
||||
|
@@ -58,12 +58,6 @@ static_assert(sizeof(MTPdouble) == 8, "Basic types size check failed");
|
||||
|
||||
static_assert(sizeof(int) >= 4, "Basic types size check failed");
|
||||
|
||||
namespace {
|
||||
|
||||
std::atomic<int> GlobalAtomicRequestId = 0;
|
||||
|
||||
} // namespace
|
||||
|
||||
// Precise timing functions / rand init
|
||||
|
||||
struct CRYPTO_dynlock_value {
|
||||
@@ -206,14 +200,6 @@ namespace ThirdParty {
|
||||
}
|
||||
}
|
||||
|
||||
int GetNextRequestId() {
|
||||
const auto result = ++GlobalAtomicRequestId;
|
||||
if (result == std::numeric_limits<int>::max() / 2) {
|
||||
GlobalAtomicRequestId = 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
int32 *hashSha1(const void *data, uint32 len, void *dest) {
|
||||
return (int32*)SHA1((const uchar*)data, (size_t)len, (uchar*)dest);
|
||||
}
|
||||
|
@@ -82,8 +82,6 @@ inline QByteArray str_const_toByteArray(const str_const &str) {
|
||||
return QByteArray::fromRawData(str.c_str(), str.size());
|
||||
}
|
||||
|
||||
int GetNextRequestId();
|
||||
|
||||
inline void mylocaltime(struct tm * _Tm, const time_t * _Time) {
|
||||
#ifdef Q_OS_WIN
|
||||
localtime_s(_Tm, _Time);
|
||||
@@ -161,8 +159,6 @@ T rand_value() {
|
||||
return result;
|
||||
}
|
||||
|
||||
static const QRegularExpression::PatternOptions reMultiline(QRegularExpression::DotMatchesEverythingOption | QRegularExpression::MultilineOption);
|
||||
|
||||
template <typename T>
|
||||
inline T snap(const T &v, const T &_min, const T &_max) {
|
||||
return (v < _min) ? _min : ((v > _max) ? _max : v);
|
||||
|
Reference in New Issue
Block a user