From 769a397a03cf2974d3b029b43a9e6505196d343a Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Tue, 16 Dec 2025 17:24:15 +0200 Subject: [PATCH] tomatrix: don't use portal disappearing timer for incoming messages --- pkg/connector/tomatrix.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/connector/tomatrix.go b/pkg/connector/tomatrix.go index e0088cbe..11f42f3a 100644 --- a/pkg/connector/tomatrix.go +++ b/pkg/connector/tomatrix.go @@ -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, } }