Skip to content

Commit

Permalink
Fixed bug in getCommentData that made the flag commentTo respond to t…
Browse files Browse the repository at this point in the history
…he wrong message (#697)

This bug occured only if in the message where more then 1 media file.
  • Loading branch information
SRS69 authored Jul 28, 2024
1 parent 9233537 commit fbe3057
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gramjs/client/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit fbe3057

Please sign in to comment.