Răsfoiți Sursa

Try to fix finish init with empty messages

Painor 6 luni în urmă
părinte
comite
3d77d52531
5 a modificat fișierele cu 8 adăugiri și 7 ștergeri
  1. 1 1
      gramjs/Version.ts
  2. 3 3
      gramjs/client/messageParse.ts
  3. 1 0
      gramjs/tl/patched/index.ts
  4. 2 2
      package-lock.json
  5. 1 1
      package.json

+ 1 - 1
gramjs/Version.ts

@@ -1 +1 @@
-export const version = "2.25.14";
+export const version = "2.26.1";

+ 3 - 3
gramjs/client/messageParse.ts

@@ -211,7 +211,7 @@ export function _getResponseMessage(
             return schedMessage;
             return schedMessage;
         }
         }
         client._log.warn(
         client._log.warn(
-            `No randomId in ${request} to map to. returning undefined for ${result}`
+            `No randomId in ${request} to map to. returning undefined for ${result} (Message was empty)`
         );
         );
         return undefined;
         return undefined;
     }
     }
@@ -219,7 +219,7 @@ export function _getResponseMessage(
         let msg = idToMessage.get(randomToId.get(randomId.toString())!);
         let msg = idToMessage.get(randomToId.get(randomId.toString())!);
         if (!msg) {
         if (!msg) {
             client._log.warn(
             client._log.warn(
-                `Request ${request.className} had missing message mapping ${result.className}`
+                `Request ${request.className} had missing message mapping ${result.className} (Message was empty)`
             );
             );
         }
         }
         return msg;
         return msg;
@@ -241,7 +241,7 @@ export function _getResponseMessage(
     }
     }
     if (warned) {
     if (warned) {
         client._log.warn(
         client._log.warn(
-            `Request ${request.className} had missing message mapping ${result.className}`
+            `Request ${request.className} had missing message mapping ${result.className} (Message was empty)`
         );
         );
     }
     }
     const finalToReturn = [];
     const finalToReturn = [];

+ 1 - 0
gramjs/tl/patched/index.ts

@@ -80,6 +80,7 @@ function patchClass(clazz: Function) {
 function patchAll() {
 function patchAll() {
     patchClass(Api.Message);
     patchClass(Api.Message);
     patchClass(Api.MessageService);
     patchClass(Api.MessageService);
+    patchClass(Api.MessageEmpty);
 }
 }
 
 
 export { patchAll };
 export { patchAll };

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "2.25.15",
+  "version": "2.26.2",
   "lockfileVersion": 2,
   "lockfileVersion": 2,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "telegram",
       "name": "telegram",
-      "version": "2.25.15",
+      "version": "2.26.2",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@cryptography/aes": "^0.1.1",
         "@cryptography/aes": "^0.1.1",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "telegram",
   "name": "telegram",
-  "version": "2.25.15",
+  "version": "2.26.2",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "description": "NodeJS/Browser MTProto API Telegram client library,",
   "main": "index.js",
   "main": "index.js",
   "types": "index.d.ts",
   "types": "index.d.ts",