This commit is contained in:
Joseph Mansy 2023-08-10 02:03:15 +05:00 committed by GitHub
commit 2dcace5bd4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -383,7 +383,7 @@ func (b *Bwhatsapp) Send(msg config.Message) (string, error) {
return "", nil
}
_, err := b.wc.RevokeMessage(groupJID, msg.ID)
_, err := b.wc.SendMessage(context.Background(), groupJID, b.wc.BuildRevoke(groupJID, extendedMsgID.Sender, extendedMsgID.MessageID))
return "", err
}

View File

@ -466,7 +466,8 @@ func (gw *Gateway) SendMessage(
// exclude file delete event as the msg ID here is the native file ID that needs to be deleted
if msg.Event != config.EventFileDelete {
msg.ID = gw.getDestMsgID(rmsg.Protocol+" "+rmsg.ID, dest, channel)
canonicalMsgID := gw.FindCanonicalMsgID(rmsg.Protocol, rmsg.ID)
msg.ID = gw.getDestMsgID(canonicalMsgID, dest, channel)
}
// for api we need originchannel as channel

View File

@ -134,8 +134,9 @@ func (r *Router) handleReceive() {
r.handleEventFailure(&msg)
r.handleEventRejoinChannels(&msg)
srcBridge := r.getBridge(msg.Account)
// Set message protocol based on the account it came from
msg.Protocol = r.getBridge(msg.Account).Protocol
msg.Protocol = srcBridge.Protocol
filesHandled := false
for _, gw := range r.Gateways {
@ -163,6 +164,11 @@ func (r *Router) handleReceive() {
// This is necessary as msgIDs will change if a bridge returns
// a different ID in response to edits.
if !exists {
// we're adding the original message as a "dest message"
// as when we get the dest messages for a delete the source message isnt in the list
// therefore the delete doesnt happen on the source platform.
msgIDs = append(msgIDs, &BrMsgID{srcBridge, srcBridge.Protocol + " " + msg.ID, msg.Channel + srcBridge.Account})
gw.Messages.Add(msg.Protocol+" "+msg.ID, msgIDs)
}
}