@mtcute/core 0.20.2 → 0.20.4

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.
@@ -359,7 +359,7 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
359
359
  return uploadMediaIfNeeded(
360
360
  {
361
361
  _: "inputMediaUploadedDocument",
362
- nosoundVideo: media.type === "video" && media.isAnimated,
362
+ nosoundVideo: media.type === "video" && !media.isAnimated,
363
363
  forceFile: media.type === "document",
364
364
  file: inputFile,
365
365
  thumb,
@@ -352,7 +352,7 @@ async function _normalizeInputMedia(client, media, params = {}, uploadMedia = fa
352
352
  return uploadMediaIfNeeded(
353
353
  {
354
354
  _: "inputMediaUploadedDocument",
355
- nosoundVideo: media.type === "video" && media.isAnimated,
355
+ nosoundVideo: media.type === "video" && !media.isAnimated,
356
356
  forceFile: media.type === "document",
357
357
  file: inputFile,
358
358
  thumb,
@@ -220,7 +220,7 @@ class NetworkManager {
220
220
  _: "initConnection",
221
221
  deviceModel,
222
222
  systemVersion: "1.0",
223
- appVersion: "0.20.2",
223
+ appVersion: "0.20.4",
224
224
  systemLangCode: "en",
225
225
  langPack: "",
226
226
  // "langPacks are for official apps only"
@@ -213,7 +213,7 @@ class NetworkManager {
213
213
  _: "initConnection",
214
214
  deviceModel,
215
215
  systemVersion: "1.0",
216
- appVersion: "0.20.2",
216
+ appVersion: "0.20.4",
217
217
  systemLangCode: "en",
218
218
  langPack: "",
219
219
  // "langPacks are for official apps only"
@@ -172,7 +172,8 @@ class PersistentConnection {
172
172
  try {
173
173
  await this._writer.write(data);
174
174
  } catch (e) {
175
- this.log.warn("encountered an error closed while sending, reconnecting: %e", e);
175
+ this.log.warn("encountered an error while sending, reconnecting: %e", e);
176
+ this._writer = void 0;
176
177
  this._fuman.reconnect(true);
177
178
  this._sendOnceConnected.push(data);
178
179
  }
@@ -165,7 +165,8 @@ class PersistentConnection {
165
165
  try {
166
166
  await this._writer.write(data);
167
167
  } catch (e) {
168
- this.log.warn("encountered an error closed while sending, reconnecting: %e", e);
168
+ this.log.warn("encountered an error while sending, reconnecting: %e", e);
169
+ this._writer = void 0;
169
170
  this._fuman.reconnect(true);
170
171
  this._sendOnceConnected.push(data);
171
172
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mtcute/core",
3
3
  "type": "module",
4
- "version": "0.20.2",
4
+ "version": "0.20.4",
5
5
  "description": "Type-safe library for MTProto (Telegram API)",
6
6
  "license": "MIT",
7
7
  "scripts": {},