imagepack: switch to new shared metadata field

This commit is contained in:
Tulir Asokan
2026-04-27 20:24:10 +03:00
parent 9e1c42a992
commit e6243d8935
7 changed files with 132 additions and 107 deletions
+3 -15
View File
@@ -618,21 +618,9 @@ func (tc *TelegramClient) convertMediaRequiringUpload(
content.FileName = content.Body
content.Body = a.Alt
}
stickerInfo := map[string]any{"alt": a.Alt, "id": strconv.FormatInt(document.ID, 10)}
if setID, ok := a.Stickerset.(*tg.InputStickerSetID); ok {
stickerInfo["pack"] = map[string]any{
"id": strconv.FormatInt(setID.ID, 10),
"access_hash": strconv.FormatInt(setID.AccessHash, 10),
"access_hash_source": strconv.FormatInt(tc.telegramUserID, 10),
}
} else if shortName, ok := a.Stickerset.(*tg.InputStickerSetShortName); ok {
stickerInfo["pack"] = map[string]any{
"short_name": shortName.ShortName,
}
}
extraInfo["fi.mau.telegram.sticker"] = stickerInfo
transferer = transferer.WithStickerConfig(tc.main.Config.AnimatedSticker)
transferer = transferer.
WithStickerConfig(tc.main.Config.AnimatedSticker).
WithStickerMetadata(tc.stickerSourceFromAttribute(ctx, document.ID, a))
case *tg.DocumentAttributeAnimated:
isVideoGif = true
extraInfo["fi.mau.telegram.gif"] = true