소스 검색

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 (