From 82e3cef9398f8761b0a298b38f9a903426b1ed6f Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 15 Feb 2024 12:03:17 +0300 Subject: [PATCH] Ignore duplicate animations in premium state. --- td/telegram/Premium.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/td/telegram/Premium.cpp b/td/telegram/Premium.cpp index 5b5c99db8..530e5cf43 100644 --- a/td/telegram/Premium.cpp +++ b/td/telegram/Premium.cpp @@ -222,9 +222,15 @@ class GetPremiumPromoQuery final : public Td::ResultHandler { } vector> animations; + FlatHashSet video_sections; for (size_t i = 0; i < promo->video_sections_.size(); i++) { auto feature = get_premium_feature_object(promo->video_sections_[i]); if (feature == nullptr) { + LOG(INFO) << "Receive unknown Premium feature animation " << promo->video_sections_[i]; + continue; + } + if (!video_sections.insert(promo->video_sections_[i]).second) { + LOG(ERROR) << "Receive duplicate Premium feature animation " << promo->video_sections_[i]; continue; }