From 8bef95e2378d0017a5ef652bdbf197233436e027 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 3 Dec 2025 17:05:25 +0200 Subject: [PATCH] chatinfo,backfill,tomatrix: downgrade unnecessary warnings --- pkg/connector/backfill.go | 2 +- pkg/connector/chatinfo.go | 2 +- pkg/connector/tomatrix.go | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pkg/connector/backfill.go b/pkg/connector/backfill.go index 6073b504..9b18a24e 100644 --- a/pkg/connector/backfill.go +++ b/pkg/connector/backfill.go @@ -296,7 +296,7 @@ func (t *TelegramClient) FetchMessages(ctx context.Context, fetchParams bridgev2 message, ok := msg.(*tg.Message) if !ok { - log.Warn().Str("type", msg.TypeName()).Msg("skipping backfilling unsupported message type") + log.Debug().Str("type", msg.TypeName()).Msg("skipping backfilling unsupported message type") continue } diff --git a/pkg/connector/chatinfo.go b/pkg/connector/chatinfo.go index 5e882920..2ddebd46 100644 --- a/pkg/connector/chatinfo.go +++ b/pkg/connector/chatinfo.go @@ -204,7 +204,7 @@ func (t *TelegramClient) avatarFromPhoto(ctx context.Context, peerType ids.PeerT zerolog.Ctx(ctx).Trace().Msg("Chat photo is nil, returning no avatar") return nil } else if photo.TypeID() != tg.PhotoTypeID { - zerolog.Ctx(ctx).Warn().Uint32("type_id", photo.TypeID()).Msg("Chat photo type unknown, returning no avatar") + zerolog.Ctx(ctx).Debug().Str("type_name", photo.TypeName()).Msg("Chat photo type unknown, returning no avatar") return nil } avatar, err := t.convertPhoto(ctx, peerType, peerID, photo) diff --git a/pkg/connector/tomatrix.go b/pkg/connector/tomatrix.go index 07bd97ed..159cf820 100644 --- a/pkg/connector/tomatrix.go +++ b/pkg/connector/tomatrix.go @@ -57,15 +57,20 @@ func mediaHashID(ctx context.Context, m tg.MessageMediaClass) []byte { } switch media := m.(type) { case *tg.MessageMediaPhoto: - if media != nil && media.Photo != nil { + if media.Photo != nil { return binary.BigEndian.AppendUint64(nil, uint64(media.Photo.GetID())) + } else { + zerolog.Ctx(ctx).Debug().Msg("Attempted to get hash for nil photo") } case *tg.MessageMediaDocument: - if media != nil && media.Document != nil { + if media.Document != nil { return binary.BigEndian.AppendUint64(nil, uint64(media.Document.GetID())) + } else { + zerolog.Ctx(ctx).Debug().Msg("Attempted to get hash for nil document") } + default: + zerolog.Ctx(ctx).Debug().Type("media_type", m).Msg("Attempted to get hash for unsupported media type ID") } - zerolog.Ctx(ctx).Error().Type("media_type", m).Msg("Attempted to get hash for unsupported media type ID") return nil }