Преглед на файлове

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 преди 1 година
родител
ревизия
fbe3057816
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  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 (