@whanext/core 0.14.1 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/dist/index.d.ts +0 -6
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.14.2
|
|
4
|
+
|
|
5
|
+
### Corrigido
|
|
6
|
+
|
|
7
|
+
- Mensagens privadas recebidas agora combinam `remoteJid` e `remoteJidAlt` nas identidades normalizadas do remetente, preservando PN JID e LID quando o WhatsApp fornece ambos.
|
|
8
|
+
- `message.sender`, `message.senderIds` e `ctx.user.phone` passam a expor corretamente o número do remetente em chats privados LID sem exigir tratamento de Baileys na aplicação.
|
|
9
|
+
- A identidade alternativa só é usada para mensagens recebidas em chats privados; mensagens de grupo e mensagens `fromMe` mantêm o comportamento anterior.
|
|
10
|
+
|
|
11
|
+
### Compatibilidade
|
|
12
|
+
|
|
13
|
+
- Nenhuma API pública foi removida ou alterada. Aplicações que já usam `ctx.user.phone` passam apenas a receber o número em mais casos.
|
|
14
|
+
|
|
3
15
|
## 0.14.1
|
|
4
16
|
|
|
5
17
|
### Corrigido
|
package/README.md
CHANGED
|
@@ -584,6 +584,8 @@ console.log(app.account.selfChatId); // destino preferencial para falar consigo
|
|
|
584
584
|
|
|
585
585
|
`selfChatId` prioriza o PN JID canônico e remove automaticamente sufixos de dispositivo como `:12@s.whatsapp.net`.
|
|
586
586
|
|
|
587
|
+
Em conversas privadas endereçadas por LID, o provider também aproveita o `remoteJidAlt` enviado pelo WhatsApp para preencher a identidade PN do remetente. Assim, quando esse mapeamento estiver presente no evento ao vivo, `ctx.user.phone` continua retornando o número normalmente mesmo que `ctx.chatId` termine em `@lid`.
|
|
588
|
+
|
|
587
589
|
Na API legada, use `onlyOwner: true`:
|
|
588
590
|
|
|
589
591
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -86,14 +86,8 @@ interface QuotedMessage {
|
|
|
86
86
|
senderId?: string;
|
|
87
87
|
sender?: User;
|
|
88
88
|
hasMedia: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Indica se a mensagem citada foi enviada como visualização única.
|
|
91
|
-
* O provider oficial sempre preenche este campo.
|
|
92
|
-
*/
|
|
93
89
|
isViewOnce?: boolean;
|
|
94
|
-
/** Classificação normalizada do conteúdo citado. */
|
|
95
90
|
contentKind?: MessageContentKind;
|
|
96
|
-
/** Metadados da mídia citada, quando houver. */
|
|
97
91
|
media?: MessageMedia;
|
|
98
92
|
}
|
|
99
93
|
interface Message {
|
package/dist/index.js
CHANGED
|
@@ -2388,10 +2388,14 @@ function normalizeBaileysMessage(input) {
|
|
|
2388
2388
|
const type = getContentType(content);
|
|
2389
2389
|
const node = type ? content[type] : void 0;
|
|
2390
2390
|
const context = getContextInfo(node);
|
|
2391
|
+
const isPrivateIncoming = !chatId.endsWith("@g.us") && input.key.fromMe !== true;
|
|
2392
|
+
const remoteJidAlt = input.key.remoteJidAlt;
|
|
2391
2393
|
const senderIds = uniqueIdentities([
|
|
2392
2394
|
input.key.participant,
|
|
2393
2395
|
input.key.participantAlt,
|
|
2394
|
-
input.key.participantUsername?.includes("@") ? input.key.participantUsername : void 0
|
|
2396
|
+
input.key.participantUsername?.includes("@") ? input.key.participantUsername : void 0,
|
|
2397
|
+
isPrivateIncoming ? remoteJidAlt : void 0,
|
|
2398
|
+
isPrivateIncoming ? chatId : void 0
|
|
2395
2399
|
]);
|
|
2396
2400
|
const senderJid = senderIds.find((identity) => identity.endsWith("@s.whatsapp.net") || identity.endsWith("@c.us"));
|
|
2397
2401
|
const senderLid = senderIds.find((identity) => identity.endsWith("@lid"));
|