From aa28b6bd3876f08e31996f1e8f64525b14407d2d Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 8 Aug 2023 23:18:00 +0300 Subject: [PATCH] Send tombstone messages as bridge bot --- portal.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/portal.go b/portal.go index acfd647..4c93eec 100644 --- a/portal.go +++ b/portal.go @@ -593,9 +593,17 @@ func (portal *Portal) convertGoogleMessage(ctx context.Context, source *User, ev cm.SenderID = evt.ParticipantID cm.ID = evt.MessageID cm.Timestamp = time.UnixMicro(evt.Timestamp) - cm.Intent = portal.getIntent(ctx, source, evt.ParticipantID) - if cm.Intent == nil { - return nil + msgStatus := evt.GetMessageStatus().GetStatus() + if msgStatus >= 200 && msgStatus < 300 { + cm.Intent = portal.bridge.Bot + if !portal.Encrypted && portal.IsPrivateChat() { + cm.Intent = portal.MainIntent() + } + } else { + cm.Intent = portal.getIntent(ctx, source, evt.ParticipantID) + if cm.Intent == nil { + return nil + } } var replyTo id.EventID