tomatrix: don't use portal disappearing timer for incoming messages

This commit is contained in:
Tulir Asokan
2025-12-16 17:24:15 +02:00
parent 1dde2a4a77
commit 769a397a03

View File

@@ -223,16 +223,10 @@ func (c *TelegramClient) convertToMatrix(
}
}
if disappearingSetting == nil {
// The TTL is either included in the message, or it's on the portal's
// metadata.
if ttl, ok := msg.GetTTLPeriod(); ok {
cm.Disappear = database.DisappearingSetting{
Type: event.DisappearingTypeAfterSend,
Timer: time.Duration(ttl) * time.Second,
}
} else {
cm.Disappear = portal.Disappear
if ttl, ok := msg.GetTTLPeriod(); ok && disappearingSetting == nil {
cm.Disappear = database.DisappearingSetting{
Type: event.DisappearingTypeAfterSend,
Timer: time.Duration(ttl) * time.Second,
}
}