@@ -69,7 +69,6 @@ import makeWASocket, {
6969 WAMessage ,
7070 WAMessageUpdate ,
7171 WASocket ,
72- WAVersion ,
7372} from '@whiskeysockets/baileys' ;
7473import {
7574 ConfigService ,
@@ -847,10 +846,12 @@ export class WAStartupService {
847846
848847 messagesRaw . push ( {
849848 keyId : m . key . id ,
850- keyRemoteJid : this . normalizeJid ( m . key ) ,
851849 keyFromMe : m . key . fromMe ,
852850 pushName : m ?. pushName || m . key . remoteJid . split ( '@' ) [ 0 ] ,
853- keyParticipant : m ?. participant || this . normalizeParticipant ( m . key ) ,
851+ keyRemoteJid : m . key ?. remoteJid ,
852+ keyLid : m . key ?. [ 'senderLid' ] || m . key ?. [ 'senderPn' ] ,
853+ keyParticipant : m ?. participant || m . key ?. participant ,
854+ keyParticipantLid : m . key ?. [ 'participantLid' ] || m . key ?. [ 'participantPn' ] ,
854855 messageType,
855856 content : m . message [ messageType ] as PrismType . Prisma . JsonValue ,
856857 messageTimestamp : timestamp ,
@@ -926,11 +927,13 @@ export class WAStartupService {
926927
927928 const messageRaw = {
928929 keyId : received . key . id ,
929- keyRemoteJid : this . normalizeJid ( received . key ) ,
930930 keyFromMe : received . key . fromMe ,
931931 pushName : received . pushName ,
932- keyParticipant :
933- received ?. participant || this . normalizeParticipant ( received . key ) ,
932+ keyRemoteJid : received . key ?. remoteJid ,
933+ keyLid : received . key ?. [ 'senderLid' ] || received . key ?. [ 'senderPn' ] ,
934+ keyParticipant : received ?. participant || received . key ?. participant ,
935+ keyParticipantLid :
936+ received . key ?. [ 'participantLid' ] || received . key ?. [ 'participantPn' ] ,
934937 messageType,
935938 content : JSON . parse (
936939 JSON . stringify ( received . message [ messageType ] ) ,
@@ -1238,14 +1241,6 @@ export class WAStartupService {
12381241 }
12391242 }
12401243
1241- private normalizeJid ( key : proto . IMessageKey ) {
1242- return key ?. remoteJid || key ?. [ 'remoteJidAlt' ] || key ?. [ 'lid' ] ;
1243- }
1244-
1245- private normalizeParticipant ( key : proto . IMessageKey ) {
1246- return key ?. participant || key ?. [ 'participantAlt' ] ;
1247- }
1248-
12491244 private createJid ( number : string ) : string {
12501245 if (
12511246 number . includes ( '@g.us' ) ||
@@ -2078,7 +2073,7 @@ export class WAStartupService {
20782073 for await ( const number of data . numbers ) {
20792074 const jid = this . createJid ( number ) ;
20802075 if ( isLidUser ( jid ) ) {
2081- onWhatsapp . push ( new OnWhatsAppDto ( jid , ! ! true , jid ) ) ;
2076+ onWhatsapp . push ( new OnWhatsAppDto ( jid , true , jid ) ) ;
20822077 }
20832078 if ( isJidGroup ( jid ) ) {
20842079 const group = await this . findGroup ( { groupJid : jid } , 'inner' ) ;
0 commit comments