From ee030cf5f7fb12e82176ee819000caba260f4f8a Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 21 Mar 2024 15:43:00 +0300 Subject: [PATCH] Don't add standalone stickers to recent when they are sent. --- td/telegram/StickersManager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {