File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
src/api/integrations/channel/whatsapp Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1140,6 +1140,27 @@ export class BaileysStartupService extends ChannelStartupService {
11401140 ) ;
11411141
11421142 await this . sendDataWebhook ( Events . MESSAGES_EDITED , editedMessage ) ;
1143+ const oldMessage = await this . getMessage ( editedMessage . key , true ) ;
1144+ if ( ( oldMessage as any ) ?. id ) {
1145+ await this . prismaRepository . message . update ( {
1146+ where : { id : ( oldMessage as any ) . id } ,
1147+ data : {
1148+ message : editedMessage . editedMessage as any ,
1149+ messageTimestamp : ( editedMessage . timestampMs as Long . Long ) . toNumber ( ) ,
1150+ status : 'EDITED' ,
1151+ } ,
1152+ } ) ;
1153+ await this . prismaRepository . messageUpdate . create ( {
1154+ data : {
1155+ fromMe : editedMessage . key . fromMe ,
1156+ keyId : editedMessage . key . id ,
1157+ remoteJid : editedMessage . key . remoteJid ,
1158+ status : 'EDITED' ,
1159+ instanceId : this . instanceId ,
1160+ messageId : ( oldMessage as any ) . id ,
1161+ } ,
1162+ } ) ;
1163+ }
11431164 }
11441165 }
11451166
You can’t perform that action at this time.
0 commit comments