Send tombstone messages as bridge bot
This commit is contained in:
parent
f9d004a09d
commit
aa28b6bd38
1 changed files with 11 additions and 3 deletions
14
portal.go
14
portal.go
|
@ -593,9 +593,17 @@ func (portal *Portal) convertGoogleMessage(ctx context.Context, source *User, ev
|
||||||
cm.SenderID = evt.ParticipantID
|
cm.SenderID = evt.ParticipantID
|
||||||
cm.ID = evt.MessageID
|
cm.ID = evt.MessageID
|
||||||
cm.Timestamp = time.UnixMicro(evt.Timestamp)
|
cm.Timestamp = time.UnixMicro(evt.Timestamp)
|
||||||
cm.Intent = portal.getIntent(ctx, source, evt.ParticipantID)
|
msgStatus := evt.GetMessageStatus().GetStatus()
|
||||||
if cm.Intent == nil {
|
if msgStatus >= 200 && msgStatus < 300 {
|
||||||
return nil
|
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
|
var replyTo id.EventID
|
||||||
|
|
Loading…
Reference in a new issue