diff --git a/pkg/connector/handlematrix.go b/pkg/connector/handlematrix.go index fd7521f6..13ccafde 100644 --- a/pkg/connector/handlematrix.go +++ b/pkg/connector/handlematrix.go @@ -560,7 +560,7 @@ func (t *TelegramClient) PreHandleMatrixReaction(ctx context.Context, msg *bridg keyNoVariation := variationselector.Remove(msg.Content.RelatesTo.Key) emojiID := ids.MakeEmojiIDFromEmoticon(msg.Content.RelatesTo.Key) if strings.HasPrefix(msg.Content.RelatesTo.Key, "mxc://") { - if file, err := t.main.Store.TelegramFile.GetByMXC(ctx, msg.Content.RelatesTo.Key); err != nil { + if file, err := t.main.Store.TelegramFile.GetByMXC(ctx, id.ContentURIString(msg.Content.RelatesTo.Key)); err != nil { return resp, err } else if file == nil { return resp, fmt.Errorf("reaction MXC URI %s does not correspond with any known Telegram files", msg.Content.RelatesTo.Key) diff --git a/pkg/connector/matrixfmt/html.go b/pkg/connector/matrixfmt/html.go index 6a2c932f..3ba2ecb8 100644 --- a/pkg/connector/matrixfmt/html.go +++ b/pkg/connector/matrixfmt/html.go @@ -405,7 +405,7 @@ func (parser *HTMLParser) imgToString(node *html.Node, ctx Context) *EntityStrin if !isEmoji { return NewEntityString(alt) } - if file, _ := parser.Store.TelegramFile.GetByMXC(ctx.Ctx, src); file != nil { + if file, _ := parser.Store.TelegramFile.GetByMXC(ctx.Ctx, id.ContentURIString(src)); file != nil { if documentID, err := strconv.ParseInt(string(file.LocationID), 10, 64); err == nil { // Hardcode to a sparkle emoji because telegram requires the custom emoji fallback to be an emoji, // but we don't know the actual emoji that should be used. diff --git a/pkg/connector/store/telegramfile.go b/pkg/connector/store/telegramfile.go index 9154957a..9fb2de26 100644 --- a/pkg/connector/store/telegramfile.go +++ b/pkg/connector/store/telegramfile.go @@ -60,7 +60,7 @@ func (fq *TelegramFileQuery) GetByLocationID(ctx context.Context, locationID Tel return fq.QueryOne(ctx, getTelegramFileByLocationIDQuery, locationID) } -func (fq *TelegramFileQuery) GetByMXC(ctx context.Context, mxc string) (*TelegramFile, error) { +func (fq *TelegramFileQuery) GetByMXC(ctx context.Context, mxc id.ContentURIString) (*TelegramFile, error) { return fq.QueryOne(ctx, getTelegramFileByMXCQuery, mxc) }