diff --git a/td/telegram/StickersManager.cpp b/td/telegram/StickersManager.cpp index 0235cdeb2..148721f48 100644 --- a/td/telegram/StickersManager.cpp +++ b/td/telegram/StickersManager.cpp @@ -9044,8 +9044,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() && sticker->format_ != StickerFormat::Webp && - sticker->format_ != StickerFormat::Webm) { + if (!sticker->set_id_.is_valid() && + (!add_on_server || (sticker->format_ != StickerFormat::Webp && sticker->format_ != StickerFormat::Webm))) { return promise.set_error(Status::Error(400, "The sticker must be from a sticker set")); } if (sticker->type_ == StickerType::CustomEmoji) { @@ -9426,8 +9426,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() && sticker->format_ != StickerFormat::Webp && - sticker->format_ != StickerFormat::Webm) { + if (!sticker->set_id_.is_valid() && + (!add_on_server || (sticker->format_ != StickerFormat::Webp && sticker->format_ != StickerFormat::Webm))) { return promise.set_error(Status::Error(400, "The sticker must be from a sticker set")); } if (sticker->type_ == StickerType::CustomEmoji) {