@mtkruto/node 0.1.111 → 0.1.112

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.
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 166;
8
- export declare const APP_VERSION = "MTKruto 0.1.111";
8
+ export declare const APP_VERSION = "MTKruto 0.1.112";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -54,7 +54,7 @@ export const PUBLIC_KEYS = Object.freeze([
54
54
  export const VECTOR_CONSTRUCTOR = 0x1CB5C415;
55
55
  export const INITIAL_DC = "2";
56
56
  export const LAYER = 166;
57
- export const APP_VERSION = "MTKruto 0.1.111";
57
+ export const APP_VERSION = "MTKruto 0.1.112";
58
58
  // @ts-ignore: lib
59
59
  export const DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
60
60
  export const LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -1196,6 +1196,9 @@ export class Client extends ClientAbstract {
1196
1196
  const messages = new Array();
1197
1197
  if (updates instanceof types.Updates) {
1198
1198
  for (const update of updates.updates) {
1199
+ if ("message" in update && update.message instanceof types.MessageEmpty) {
1200
+ continue;
1201
+ }
1199
1202
  if (update instanceof types.UpdateNewMessage || update instanceof types.UpdateEditMessage) {
1200
1203
  messages.push(await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1201
1204
  }
@@ -1267,6 +1270,9 @@ export class Client extends ClientAbstract {
1267
1270
  }
1268
1271
  const messages = new Array();
1269
1272
  for (const message_ of messages_) {
1273
+ if (message_ instanceof types.MessageEmpty) {
1274
+ continue;
1275
+ }
1270
1276
  const message = await constructMessage(message_, this[getEntity].bind(this), null, this[getStickerSetName].bind(this));
1271
1277
  const isReplyToMessage = message_ instanceof types.Message && message_.replyTo instanceof types.MessageReplyHeader;
1272
1278
  messages.push({ message, isReplyToMessage });
@@ -1837,8 +1843,10 @@ async function _Client_handleUpdate(update) {
1837
1843
  update instanceof types.UpdateEditMessage ||
1838
1844
  update instanceof types.UpdateEditChannelMessage) {
1839
1845
  const key = update instanceof types.UpdateNewMessage || update instanceof types.UpdateNewChannelMessage ? "message" : "editedMessage";
1840
- const message = await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1841
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, resolve);
1846
+ if (!(update.message instanceof types.MessageEmpty)) {
1847
+ const message = await constructMessage(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1848
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, resolve);
1849
+ }
1842
1850
  }
1843
1851
  if (update instanceof types.UpdateDeleteMessages) {
1844
1852
  const deletedMessages = new Array();
@@ -1846,7 +1854,7 @@ async function _Client_handleUpdate(update) {
1846
1854
  const chatId = await this.storage.getMessageChat(messageId);
1847
1855
  if (chatId) {
1848
1856
  const message = await this.storage.getMessage(chatId, messageId);
1849
- if (message != null) {
1857
+ if (message != null && !(message instanceof types.MessageEmpty)) {
1850
1858
  deletedMessages.push(await constructMessage(message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1851
1859
  }
1852
1860
  await this.storage.setMessage(chatId, messageId, null);
@@ -1861,7 +1869,7 @@ async function _Client_handleUpdate(update) {
1861
1869
  const deletedMessages = new Array();
1862
1870
  for (const messageId of update.messages) {
1863
1871
  const message = await this.storage.getMessage(chatId, messageId);
1864
- if (message) {
1872
+ if (message != null && !(message instanceof types.MessageEmpty)) {
1865
1873
  deletedMessages.push(await constructMessage(message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1866
1874
  }
1867
1875
  await this.storage.setMessage(chatId, messageId, null);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "module": "./esm/mod.js",
3
3
  "main": "./script/mod.js",
4
4
  "name": "@mtkruto/node",
5
- "version": "0.1.111",
5
+ "version": "0.1.112",
6
6
  "description": "MTKruto for Node.js",
7
7
  "author": "Roj <rojvv@icloud.com>",
8
8
  "license": "LGPL-3.0-or-later",
@@ -5,7 +5,7 @@ export declare const PUBLIC_KEYS: PublicKeys;
5
5
  export declare const VECTOR_CONSTRUCTOR = 481674261;
6
6
  export declare const INITIAL_DC: DC;
7
7
  export declare const LAYER = 166;
8
- export declare const APP_VERSION = "MTKruto 0.1.111";
8
+ export declare const APP_VERSION = "MTKruto 0.1.112";
9
9
  export declare const DEVICE_MODEL: string;
10
10
  export declare const LANG_CODE: string;
11
11
  export declare const LANG_PACK = "";
@@ -80,7 +80,7 @@ exports.PUBLIC_KEYS = Object.freeze([
80
80
  exports.VECTOR_CONSTRUCTOR = 0x1CB5C415;
81
81
  exports.INITIAL_DC = "2";
82
82
  exports.LAYER = 166;
83
- exports.APP_VERSION = "MTKruto 0.1.111";
83
+ exports.APP_VERSION = "MTKruto 0.1.112";
84
84
  // @ts-ignore: lib
85
85
  exports.DEVICE_MODEL = typeof dntShim.Deno === "undefined" ? typeof navigator === "undefined" ? typeof process === "undefined" ? "Unknown" : process.platform + "-" + process.arch : navigator.userAgent.split(" ")[0] : dntShim.Deno.build.os + "-" + dntShim.Deno.build.arch;
86
86
  exports.LANG_CODE = typeof navigator === "undefined" ? "en" : navigator.language.split("-")[0];
@@ -1200,6 +1200,9 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1200
1200
  const messages = new Array();
1201
1201
  if (updates instanceof _2_tl_js_1.types.Updates) {
1202
1202
  for (const update of updates.updates) {
1203
+ if ("message" in update && update.message instanceof _2_tl_js_1.types.MessageEmpty) {
1204
+ continue;
1205
+ }
1203
1206
  if (update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateEditMessage) {
1204
1207
  messages.push(await (0, _3_types_js_1.constructMessage)(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1205
1208
  }
@@ -1271,6 +1274,9 @@ class Client extends _1_client_abstract_js_1.ClientAbstract {
1271
1274
  }
1272
1275
  const messages = new Array();
1273
1276
  for (const message_ of messages_) {
1277
+ if (message_ instanceof _2_tl_js_1.types.MessageEmpty) {
1278
+ continue;
1279
+ }
1274
1280
  const message = await (0, _3_types_js_1.constructMessage)(message_, this[getEntity].bind(this), null, this[getStickerSetName].bind(this));
1275
1281
  const isReplyToMessage = message_ instanceof _2_tl_js_1.types.Message && message_.replyTo instanceof _2_tl_js_1.types.MessageReplyHeader;
1276
1282
  messages.push({ message, isReplyToMessage });
@@ -1842,8 +1848,10 @@ async function _Client_handleUpdate(update) {
1842
1848
  update instanceof _2_tl_js_1.types.UpdateEditMessage ||
1843
1849
  update instanceof _2_tl_js_1.types.UpdateEditChannelMessage) {
1844
1850
  const key = update instanceof _2_tl_js_1.types.UpdateNewMessage || update instanceof _2_tl_js_1.types.UpdateNewChannelMessage ? "message" : "editedMessage";
1845
- const message = await (0, _3_types_js_1.constructMessage)(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1846
- await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, _0_utilities_js_1.resolve);
1851
+ if (!(update.message instanceof _2_tl_js_1.types.MessageEmpty)) {
1852
+ const message = await (0, _3_types_js_1.constructMessage)(update.message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this));
1853
+ await __classPrivateFieldGet(this, _Client_handle, "f").call(this, { [key]: message }, _0_utilities_js_1.resolve);
1854
+ }
1847
1855
  }
1848
1856
  if (update instanceof _2_tl_js_1.types.UpdateDeleteMessages) {
1849
1857
  const deletedMessages = new Array();
@@ -1851,7 +1859,7 @@ async function _Client_handleUpdate(update) {
1851
1859
  const chatId = await this.storage.getMessageChat(messageId);
1852
1860
  if (chatId) {
1853
1861
  const message = await this.storage.getMessage(chatId, messageId);
1854
- if (message != null) {
1862
+ if (message != null && !(message instanceof _2_tl_js_1.types.MessageEmpty)) {
1855
1863
  deletedMessages.push(await (0, _3_types_js_1.constructMessage)(message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1856
1864
  }
1857
1865
  await this.storage.setMessage(chatId, messageId, null);
@@ -1866,7 +1874,7 @@ async function _Client_handleUpdate(update) {
1866
1874
  const deletedMessages = new Array();
1867
1875
  for (const messageId of update.messages) {
1868
1876
  const message = await this.storage.getMessage(chatId, messageId);
1869
- if (message) {
1877
+ if (message != null && !(message instanceof _2_tl_js_1.types.MessageEmpty)) {
1870
1878
  deletedMessages.push(await (0, _3_types_js_1.constructMessage)(message, this[getEntity].bind(this), this.getMessage.bind(this), this[getStickerSetName].bind(this)));
1871
1879
  }
1872
1880
  await this.storage.setMessage(chatId, messageId, null);