mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 06:26:18 +00:00
Application->Sandbox, Messenger->Application.
This commit is contained in:
@@ -18,6 +18,9 @@ using AuthKeyPtr = std::shared_ptr<AuthKey>;
|
||||
|
||||
namespace internal {
|
||||
|
||||
// Received msgIds and wereAcked msgIds count stored.
|
||||
constexpr auto kIdsBufferSize = 400;
|
||||
|
||||
class Dcenter;
|
||||
class Connection;
|
||||
|
||||
@@ -44,7 +47,7 @@ public:
|
||||
bool registerMsgId(mtpMsgId msgId, bool needAck) {
|
||||
auto i = _idsNeedAck.constFind(msgId);
|
||||
if (i == _idsNeedAck.cend()) {
|
||||
if (_idsNeedAck.size() < MTPIdsBufferSize || msgId > min()) {
|
||||
if (_idsNeedAck.size() < kIdsBufferSize || msgId > min()) {
|
||||
_idsNeedAck.insert(msgId, needAck);
|
||||
return true;
|
||||
}
|
||||
@@ -66,7 +69,7 @@ public:
|
||||
|
||||
void shrink() {
|
||||
auto size = _idsNeedAck.size();
|
||||
while (size-- > MTPIdsBufferSize) {
|
||||
while (size-- > kIdsBufferSize) {
|
||||
_idsNeedAck.erase(_idsNeedAck.begin());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user