Allow tags with label but without count.
This commit is contained in:
parent
588b889e4c
commit
839969e255
@ -1624,7 +1624,7 @@ chatAvailableReactionsAll = ChatAvailableReactions;
|
||||
chatAvailableReactionsSome reactions:vector<ReactionType> = ChatAvailableReactions;
|
||||
|
||||
|
||||
//@description Represents a tag used in Saved Messages @tag The tag @label Label of the tag; 0-12 characters @count Number of times the tag was used
|
||||
//@description Represents a tag used in Saved Messages @tag The tag @label Label of the tag; 0-12 characters @count Number of times the tag was used; may be 0 if the tag has non-empty label
|
||||
savedMessagesTag tag:ReactionType label:string count:int32 = SavedMessagesTag;
|
||||
|
||||
//@description Contains a list of tags used in Saved Messages @tags List of tags
|
||||
|
@ -275,7 +275,7 @@ void ReactionManager::SavedReactionTags::update_saved_messages_tags(const vector
|
||||
auto &tag = *it;
|
||||
if (tag.reaction_type_ == old_tag) {
|
||||
tag.count_--;
|
||||
if (tag.count_ <= 0) {
|
||||
if (!tag.is_valid()) {
|
||||
tags_.erase(it);
|
||||
}
|
||||
is_changed = true;
|
||||
|
@ -138,7 +138,7 @@ class ReactionManager final : public Actor {
|
||||
SavedReactionTag() = default;
|
||||
|
||||
bool is_valid() const {
|
||||
return !reaction_type_.is_empty() && count_ > 0;
|
||||
return !reaction_type_.is_empty() && count_ >= 0 && (count_ > 0 || !title_.empty());
|
||||
}
|
||||
|
||||
explicit SavedReactionTag(telegram_api::object_ptr<telegram_api::savedReactionTag> &&tag);
|
||||
|
Loading…
Reference in New Issue
Block a user