from-matrix: don't expect mute timestamp to be max int32

This commit is contained in:
Tulir Asokan
2025-07-23 13:43:06 +03:00
parent 840788c1e5
commit 03fe8bf782
+3 -3
View File
@@ -21,6 +21,7 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"math"
"slices" "slices"
"strings" "strings"
"time" "time"
@@ -1149,10 +1150,9 @@ func (t *TelegramClient) HandleMute(ctx context.Context, msg *bridgev2.MatrixMut
return err return err
} }
until := int(msg.Content.GetMutedUntilTime().Unix())
settings := tg.InputPeerNotifySettings{ settings := tg.InputPeerNotifySettings{
Silent: until > 0, Silent: msg.Content.IsMuted(),
MuteUntil: until, MuteUntil: int(max(0, min(msg.Content.GetMutedUntilTime().Unix(), math.MaxInt32))),
} }
_, err = t.client.API().AccountUpdateNotifySettings(ctx, &tg.AccountUpdateNotifySettingsRequest{ _, err = t.client.API().AccountUpdateNotifySettings(ctx, &tg.AccountUpdateNotifySettingsRequest{