Skip to content

Commit 3325044

Browse files
Merge pull request #2297 from oriondesign2015/develop
Feature: Endpoint para Descriptografar e Visualizar Votos de Enquetes
2 parents 604c9f9 + 6ede76f commit 3325044

File tree

6 files changed

+322
-0
lines changed

6 files changed

+322
-0
lines changed

package-lock.json

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/controllers/chat.controller.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {
22
ArchiveChatDto,
33
BlockUserDto,
4+
DecryptPollVoteDto,
45
DeleteMessage,
56
getBase64FromMediaMessageDto,
67
MarkChatUnreadDto,
@@ -114,6 +115,13 @@ export class ChatController {
114115
return await this.waMonitor.waInstances[instanceName].blockUser(data);
115116
}
116117

118+
public async decryptPollVote({ instanceName }: InstanceDto, data: DecryptPollVoteDto) {
119+
const pollCreationMessageKey = {
120+
id: data.message.key.id,
121+
remoteJid: data.remoteJid,
122+
};
123+
return await this.waMonitor.waInstances[instanceName].baileysDecryptPollVote(pollCreationMessageKey);
124+
117125
public async fetchChannels({ instanceName }: InstanceDto, query: Query<Contact>) {
118126
return await this.waMonitor.waInstances[instanceName].fetchChannels(query);
119127
}

src/api/dto/chat.dto.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,12 @@ export class BlockUserDto {
127127
number: string;
128128
status: 'block' | 'unblock';
129129
}
130+
131+
export class DecryptPollVoteDto {
132+
message: {
133+
key: {
134+
id: string;
135+
};
136+
};
137+
remoteJid: string;
138+
}

0 commit comments

Comments
 (0)