Przeglądaj źródła

GramJS: Fix missing message updates (#251)

painor 5 lat temu
rodzic
commit
2879a06bcd
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      src/lib/gramjs/network/MTProtoSender.js

+ 3 - 3
src/lib/gramjs/network/MTProtoSender.js

@@ -331,7 +331,7 @@ class MTProtoSender {
             try {
             try {
                 await this._connection.send(data)
                 await this._connection.send(data)
             } catch (e) {
             } catch (e) {
-                console.log(e)
+                this._log.error(e)
                 this._log.info('Connection closed while sending data')
                 this._log.info('Connection closed while sending data')
                 return
                 return
             }
             }
@@ -442,8 +442,8 @@ class MTProtoSender {
 
 
         const toPop = []
         const toPop = []
 
 
-        for (state in this._pending_state) {
-            if (state.containerId === msgId) {
+        for (state of Object.values(this._pending_state)) {
+            if (state.containerId.equals(msgId)) {
                 toPop.push(state.msgId)
                 toPop.push(state.msgId)
             }
             }
         }
         }