From 03fe8bf7827101258664ddf4ab358682e30c7daa Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 23 Jul 2025 13:43:06 +0300 Subject: [PATCH] from-matrix: don't expect mute timestamp to be max int32 --- pkg/connector/telegram.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/connector/telegram.go b/pkg/connector/telegram.go index 1ed32065..fa2ac8a2 100644 --- a/pkg/connector/telegram.go +++ b/pkg/connector/telegram.go @@ -21,6 +21,7 @@ import ( "context" "errors" "fmt" + "math" "slices" "strings" "time" @@ -1149,10 +1150,9 @@ func (t *TelegramClient) HandleMute(ctx context.Context, msg *bridgev2.MatrixMut return err } - until := int(msg.Content.GetMutedUntilTime().Unix()) settings := tg.InputPeerNotifySettings{ - Silent: until > 0, - MuteUntil: until, + Silent: msg.Content.IsMuted(), + MuteUntil: int(max(0, min(msg.Content.GetMutedUntilTime().Unix(), math.MaxInt32))), } _, err = t.client.API().AccountUpdateNotifySettings(ctx, &tg.AccountUpdateNotifySettingsRequest{