Explorar el Código

Fixed bug in getCommentData that made the flag commentTo respond to the wrong message (#697)

This bug occured only if in the message where more then 1 media file.
SRS69 hace 9 meses
padre
commit
fbe3057816
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      gramjs/client/messages.ts

+ 2 - 1
gramjs/client/messages.ts

@@ -1175,7 +1175,8 @@ export async function getCommentData(
             msgId: utils.getMessageId(message),
         })
     );
-    const relevantMessage = result.messages[0];
+    const relevantMessage = result.messages
+                            .reduce((p: Api.TypeMessage, c: Api.TypeMessage) => (p && p.id < c.id ? p : c));
     let chat;
     for (const c of result.chats) {
         if (