Don't add standalone stickers to recent when they are sent.

This commit is contained in:
levlam 2024-03-21 15:43:00 +03:00
parent c3e0a8022a
commit ee030cf5f7

View File

@ -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) {