Allow to add to recent stickers arbitrary WEBP stickers.

This commit is contained in:
levlam 2024-03-01 22:35:48 +03:00
parent f726ca930b
commit e2eba91ee2
2 changed files with 3 additions and 3 deletions

View File

@ -9239,7 +9239,7 @@ reorderInstalledStickerSets sticker_type:StickerType sticker_set_ids:vector<int6
getRecentStickers is_attached:Bool = Stickers;
//@description Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first.
//-Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers
//-Only stickers belonging to a sticker set or in WEBP format can be added to this list. Emoji stickers can't be added to recent stickers
//@is_attached Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers
//@sticker Sticker file to add
addRecentSticker is_attached:Bool sticker:InputFile = Stickers;

View File

@ -8919,8 +8919,8 @@ void StickersManager::add_recent_sticker_impl(bool is_attached, FileId sticker_i
if (sticker == nullptr) {
return promise.set_error(Status::Error(400, "Sticker not found"));
}
if (!sticker->set_id_.is_valid()) {
return promise.set_error(Status::Error(400, "Stickers without sticker set can't be added to recent"));
if (!sticker->set_id_.is_valid() && sticker->format_ != StickerFormat::Webp) {
return promise.set_error(Status::Error(400, "Stickers must be from a sticker set"));
}
if (sticker->type_ == StickerType::CustomEmoji) {
return promise.set_error(Status::Error(400, "Custom emoji stickers can't be added to recent"));