Allow to add any WEBP sticker to favorite stickers.

This commit is contained in:
levlam 2024-03-05 22:01:19 +03:00
parent ef636ea07c
commit d1638a0fc4
2 changed files with 4 additions and 4 deletions

View File

@ -9272,7 +9272,7 @@ clearRecentStickers is_attached:Bool = Ok;
getFavoriteStickers = Stickers;
//@description Adds a new sticker to the list of favorite 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 favorite 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 favorite stickers
//@sticker Sticker file to add
addFavoriteSticker sticker:InputFile = Ok;

View File

@ -8920,7 +8920,7 @@ void StickersManager::add_recent_sticker_impl(bool is_attached, FileId sticker_i
return promise.set_error(Status::Error(400, "Sticker not found"));
}
if (!sticker->set_id_.is_valid() && sticker->format_ != StickerFormat::Webp) {
return promise.set_error(Status::Error(400, "Stickers must be from a sticker set"));
return promise.set_error(Status::Error(400, "The sticker 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"));
@ -9300,8 +9300,8 @@ void StickersManager::add_favorite_sticker_impl(FileId sticker_id, bool add_on_s
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 favorite"));
if (!sticker->set_id_.is_valid() && sticker->format_ != StickerFormat::Webp) {
return promise.set_error(Status::Error(400, "The sticker 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 favorite"));