Skip to content

Commit

Permalink
[core] Fix reactions
Browse files Browse the repository at this point in the history
  • Loading branch information
allburov committed Mar 22, 2024
1 parent d953f27 commit 742a12c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/core/engines/noweb/session.noweb.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
MessagePollRequest,
MessageReactionRequest,
MessageReplyRequest,
MessageStarRequest,
MessageTextRequest,
MessageVoiceRequest,
SendSeenRequest,
Expand Down Expand Up @@ -434,6 +435,19 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
return this.sock.sendMessage(key.remoteJid, reactionMessage);
}

async setStar(request: MessageStarRequest) {
const key = parseMessageId(request.messageId);
await this.sock.chatModify(
{
star: {
messages: [{ id: key.id, fromMe: key.fromMe }],
star: request.star,
},
},
toJID(request.chatId),
);
}

/**
* Contacts methods
*/
Expand Down Expand Up @@ -665,9 +679,9 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
private processMessageReaction(messages: any[]): WAMessageReaction[] {
const reactions = [];
for (const message of messages) {
if (!message) return;
if (!message.message) return;
if (!message.message.reactionMessage) return;
if (!message) return [];
if (!message.message) return [];
if (!message.message.reactionMessage) return [];

const id = buildMessageId(message.key);
const fromToParticipant = getFromToParticipant(message);
Expand Down

0 comments on commit 742a12c

Please sign in to comment.