chatinfo,backfill,tomatrix: downgrade unnecessary warnings
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user