Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ef36e4d3ac | ||
|
|
ba2ddd62ad | ||
|
|
6a03e1488c | ||
|
|
cabd2ed562 | ||
|
|
4a9296276d | ||
|
|
1fd84d824c |
No files matched your search
@@ -1409,7 +1409,7 @@ export class WhatsappSessionGoWSCore extends WhatsappSession {
|
||||
const hasSomeContent = !!getContentType(normalizedContent);
|
||||
if (!hasSomeContent) {
|
||||
// Ignore key distribution messages
|
||||
if (message.message.senderKeyDistributionMessage) return;
|
||||
if (message?.Message?.senderKeyDistributionMessage) return;
|
||||
}
|
||||
|
||||
if (downloadMedia) {
|
||||
|
||||
@@ -2,6 +2,7 @@ import makeWASocket, {
|
||||
Browsers,
|
||||
Chat,
|
||||
Contact,
|
||||
decryptPollVote,
|
||||
DisconnectReason,
|
||||
downloadMediaMessage,
|
||||
extractMessageContent,
|
||||
@@ -397,6 +398,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
this.sock = await this.makeSocket();
|
||||
|
||||
this.issueMessageUpdateOnEdits();
|
||||
this.issueMessageUpdateOnPoll();
|
||||
this.fixMessageUpsertStatus();
|
||||
this.issuePresenceUpdateOnMessageUpsert();
|
||||
if (this.isDebugEnabled()) {
|
||||
@@ -604,6 +606,67 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
});
|
||||
}
|
||||
|
||||
private issueMessageUpdateOnPoll() {
|
||||
// Fix for https://github.com/devlikeapro/waha/issues/960
|
||||
this.sock.ev.on('messages.upsert', async ({ messages }) => {
|
||||
const meId = this.getSessionMeInfo().id;
|
||||
if (!meId) {
|
||||
return;
|
||||
}
|
||||
for (const message of messages) {
|
||||
const content = normalizeMessageContent(message.message);
|
||||
if (!content.pollUpdateMessage) {
|
||||
continue;
|
||||
}
|
||||
const creationMsgKey = content.pollUpdateMessage.pollCreationMessageKey;
|
||||
// we need to fetch the poll creation message to get the poll enc key
|
||||
const pollMsg = await this.getMessage(creationMsgKey);
|
||||
if (!pollMsg) {
|
||||
this.logger.warn(
|
||||
{ creationMsgKey },
|
||||
'poll creation message not found, cannot decrypt update',
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
const meIdNormalised = jidNormalizedUser(meId);
|
||||
const pollCreatorJid = getKeyAuthor(creationMsgKey, meIdNormalised);
|
||||
const voterJid = getKeyAuthor(message.key, meIdNormalised);
|
||||
const pollEncKey = pollMsg.messageContextInfo?.messageSecret;
|
||||
|
||||
try {
|
||||
const voteMsg = decryptPollVote(content.pollUpdateMessage.vote, {
|
||||
pollEncKey,
|
||||
pollCreatorJid,
|
||||
pollMsgId: creationMsgKey.id,
|
||||
voterJid,
|
||||
});
|
||||
this.sock.ev.emit('messages.update', [
|
||||
{
|
||||
key: creationMsgKey,
|
||||
update: {
|
||||
pollUpdates: [
|
||||
{
|
||||
pollUpdateMessageKey: message.key,
|
||||
vote: voteMsg,
|
||||
senderTimestampMs: (
|
||||
content.pollUpdateMessage.senderTimestampMs as Long
|
||||
).toNumber(),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
]);
|
||||
} catch (err) {
|
||||
this.logger.warn(
|
||||
{ err, creationMsgKey },
|
||||
'failed to decrypt poll vote',
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private issuePresenceUpdateOnMessageUpsert() {
|
||||
//
|
||||
// Fix for "typing" after sending a message
|
||||
@@ -2002,7 +2065,7 @@ export class WhatsappSessionNoWebCore extends WhatsappSession {
|
||||
const hasSomeContent = !!getContentType(normalizedContent);
|
||||
if (!hasSomeContent) {
|
||||
// Ignore key distribution messages
|
||||
if (message.message.senderKeyDistributionMessage) return;
|
||||
if (message?.message?.senderKeyDistributionMessage) return;
|
||||
}
|
||||
|
||||
if (downloadMedia) {
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ export function getEngineName(): string {
|
||||
}
|
||||
|
||||
export const VERSION: WAHAEnvironment = {
|
||||
version: '2025.5.1',
|
||||
version: '2025.5.3',
|
||||
engine: getEngineName(),
|
||||
tier: getWAHAVersion(),
|
||||
browser:
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
"waha": {
|
||||
"gows": {
|
||||
"repo": "devlikeapro/gows",
|
||||
"ref": "v1.0.4"
|
||||
"ref": "v1.0.5"
|
||||
},
|
||||
"dashboard": {
|
||||
"repo": "devlikeapro/dashboard",
|
||||
|
||||
@@ -7,7 +7,7 @@ __metadata:
|
||||
|
||||
"@adiwajshing/baileys@github:devlikeapro/Baileys#fork-master-2025-05-01":
|
||||
version: 6.7.16
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=3cdc44f0fb97bb1c50b6e518862b763211f6b739"
|
||||
resolution: "@adiwajshing/baileys@https://github.com/devlikeapro/Baileys.git#commit=94466bd31f85afd07b111dcd895b634e09130bda"
|
||||
dependencies:
|
||||
"@cacheable/node-cache": ^1.4.0
|
||||
"@hapi/boom": ^9.1.3
|
||||
@@ -34,7 +34,7 @@ __metadata:
|
||||
optional: true
|
||||
sharp:
|
||||
optional: true
|
||||
checksum: 7e9e4622b26a020428b678543ba4e59a35f679e8f00dd975eb20e7acd6afc6c465c107091a590ae7245fc3f29940611ac6f2b80fcd173fde742926887c41b563
|
||||
checksum: be827af019579bfb7b01745ff743f9875d602ccda3e2f18a54a0dd245981e8afa6aff419c55c21465a263cefe58b442f524fa2ba4c800d857ad4317c86800ae2
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in new issue
Block a user