2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Application->Sandbox, Messenger->Application.

This commit is contained in:
John Preston
2019-01-21 17:42:21 +04:00
parent 4111da1dd0
commit a70e72f75d
117 changed files with 1363 additions and 1239 deletions

View File

@@ -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());
}
}