@mtcute/core 0.27.7 → 0.27.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/highlevel/utils/file-utils.cjs +1 -1
- package/highlevel/utils/file-utils.js +1 -1
- package/network/mtproto-session.cjs +0 -1
- package/network/mtproto-session.js +0 -1
- package/network/network-manager.cjs +1 -1
- package/network/network-manager.js +1 -1
- package/network/server-salt.cjs +6 -3
- package/network/server-salt.js +6 -3
- package/package.json +5 -5
- package/storage/sqlite/driver.cjs +1 -1
- package/storage/sqlite/driver.js +1 -1
|
@@ -11,7 +11,7 @@ function determinePartSize(fileSize) {
|
|
|
11
11
|
if (fileSize <= 262078465) return 128;
|
|
12
12
|
if (fileSize <= 786432e3) return 256;
|
|
13
13
|
if (fileSize <= 2097152e3) return 512;
|
|
14
|
-
|
|
14
|
+
return 1024;
|
|
15
15
|
}
|
|
16
16
|
function isProbablyPlainText(buf) {
|
|
17
17
|
return !buf.some(
|
|
@@ -4,7 +4,7 @@ function determinePartSize(fileSize) {
|
|
|
4
4
|
if (fileSize <= 262078465) return 128;
|
|
5
5
|
if (fileSize <= 786432e3) return 256;
|
|
6
6
|
if (fileSize <= 2097152e3) return 512;
|
|
7
|
-
|
|
7
|
+
return 1024;
|
|
8
8
|
}
|
|
9
9
|
function isProbablyPlainText(buf) {
|
|
10
10
|
return !buf.some(
|
|
@@ -36,7 +36,6 @@ class MtprotoSession {
|
|
|
36
36
|
// recent msg ids
|
|
37
37
|
recentOutgoingMsgIds = new utils.LruSet(1e3, longUtils.LongSet);
|
|
38
38
|
recentIncomingMsgIds = new utils.LruSet(1e3, longUtils.LongSet);
|
|
39
|
-
// eslint-disable-next-line ts/no-unsafe-argument
|
|
40
39
|
recentStateRequests = new utils.LruMap(1e3, longUtils.LongMap);
|
|
41
40
|
// queues
|
|
42
41
|
queuedRpc = new utils.Deque();
|
|
@@ -29,7 +29,6 @@ class MtprotoSession {
|
|
|
29
29
|
// recent msg ids
|
|
30
30
|
recentOutgoingMsgIds = new LruSet(1e3, LongSet);
|
|
31
31
|
recentIncomingMsgIds = new LruSet(1e3, LongSet);
|
|
32
|
-
// eslint-disable-next-line ts/no-unsafe-argument
|
|
33
32
|
recentStateRequests = new LruMap(1e3, LongMap);
|
|
34
33
|
// queues
|
|
35
34
|
queuedRpc = new Deque();
|
package/network/server-salt.cjs
CHANGED
|
@@ -21,9 +21,12 @@ class ServerSaltManager {
|
|
|
21
21
|
this.currentSalt = salts[0].salt;
|
|
22
22
|
this._futureSalts.shift();
|
|
23
23
|
}
|
|
24
|
-
if (
|
|
25
|
-
this.currentSalt =
|
|
26
|
-
|
|
24
|
+
if (salts.length > 0 && salts[0].validSince <= now) {
|
|
25
|
+
this.currentSalt = salts[0].salt;
|
|
26
|
+
this._futureSalts.shift();
|
|
27
|
+
}
|
|
28
|
+
if (!this._futureSalts.length) ;
|
|
29
|
+
else {
|
|
27
30
|
this._scheduleReplace(this._futureSalts[0]);
|
|
28
31
|
}
|
|
29
32
|
}
|
package/network/server-salt.js
CHANGED
|
@@ -14,9 +14,12 @@ class ServerSaltManager {
|
|
|
14
14
|
this.currentSalt = salts[0].salt;
|
|
15
15
|
this._futureSalts.shift();
|
|
16
16
|
}
|
|
17
|
-
if (
|
|
18
|
-
this.currentSalt =
|
|
19
|
-
|
|
17
|
+
if (salts.length > 0 && salts[0].validSince <= now) {
|
|
18
|
+
this.currentSalt = salts[0].salt;
|
|
19
|
+
this._futureSalts.shift();
|
|
20
|
+
}
|
|
21
|
+
if (!this._futureSalts.length) ;
|
|
22
|
+
else {
|
|
20
23
|
this._scheduleReplace(this._futureSalts[0]);
|
|
21
24
|
}
|
|
22
25
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mtcute/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.27.
|
|
4
|
+
"version": "0.27.8",
|
|
5
5
|
"description": "Type-safe library for MTProto (Telegram API)",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"scripts": {},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@fuman/io": "0.0.
|
|
10
|
-
"@fuman/net": "0.0.
|
|
11
|
-
"@fuman/utils": "0.0.
|
|
12
|
-
"@mtcute/file-id": "^0.27.
|
|
9
|
+
"@fuman/io": "0.0.19",
|
|
10
|
+
"@fuman/net": "0.0.19",
|
|
11
|
+
"@fuman/utils": "0.0.19",
|
|
12
|
+
"@mtcute/file-id": "^0.27.8",
|
|
13
13
|
"@mtcute/tl": "^221.0.0",
|
|
14
14
|
"@mtcute/tl-runtime": "^0.24.3",
|
|
15
15
|
"@types/events": "3.0.0",
|
|
@@ -95,7 +95,7 @@ class BaseSqliteStorageDriver extends driver.BaseStorageDriver {
|
|
|
95
95
|
this.db = this._createDatabase();
|
|
96
96
|
this._runMany = this.db.transaction((stmts) => {
|
|
97
97
|
stmts.forEach((stmt) => {
|
|
98
|
-
stmt[0].run(stmt[1]);
|
|
98
|
+
stmt[0].run(...stmt[1]);
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
101
|
this.db.transaction(() => this._initialize())();
|
package/storage/sqlite/driver.js
CHANGED
|
@@ -88,7 +88,7 @@ class BaseSqliteStorageDriver extends BaseStorageDriver {
|
|
|
88
88
|
this.db = this._createDatabase();
|
|
89
89
|
this._runMany = this.db.transaction((stmts) => {
|
|
90
90
|
stmts.forEach((stmt) => {
|
|
91
|
-
stmt[0].run(stmt[1]);
|
|
91
|
+
stmt[0].run(...stmt[1]);
|
|
92
92
|
});
|
|
93
93
|
});
|
|
94
94
|
this.db.transaction(() => this._initialize())();
|