mirror of
https://github.com/tulir/mautrix-whatsapp
synced 2024-12-04 20:52:54 +01:00
msgconv/from-whatsapp: don't bridge no-op disappearing timer changes
This commit is contained in:
parent
dcd0b568bc
commit
eda6be5163
1 changed files with 4 additions and 2 deletions
|
@ -106,6 +106,7 @@ func (mc *MessageConverter) convertEphemeralSettingMessage(ctx context.Context,
|
|||
if disappear.Timer == 0 {
|
||||
disappear.Type = ""
|
||||
}
|
||||
dontBridge := portal.Disappear == disappear
|
||||
content := bridgev2.DisappearingMessageNotice(disappear.Timer, false)
|
||||
if msg.EphemeralSettingTimestamp == nil || portalMeta.DisappearingTimerSetAt < msg.GetEphemeralSettingTimestamp() {
|
||||
portal.Disappear = disappear
|
||||
|
@ -118,8 +119,9 @@ func (mc *MessageConverter) convertEphemeralSettingMessage(ctx context.Context,
|
|||
content.Body += ", but the change was ignored."
|
||||
}
|
||||
return &bridgev2.ConvertedMessagePart{
|
||||
Type: event.EventMessage,
|
||||
Content: content,
|
||||
Type: event.EventMessage,
|
||||
Content: content,
|
||||
DontBridge: dontBridge,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue