Skip to content

Commit

Permalink
Clear captions and drafts from empty characters.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Dec 3, 2024
1 parent 6b3ae1d commit eb98bbe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions td/telegram/MessageEntity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4494,8 +4494,12 @@ Status fix_formatted_text(string &text, vector<MessageEntity> &entities, bool al
}
LOG_CHECK(check_utf8(text)) << text;

if (!allow_empty && is_empty_string(text)) {
return Status::Error(400, "Text must be non-empty");
if (is_empty_string(text)) {
if (!allow_empty) {
return Status::Error(400, "Text must be non-empty");
}
text.clear();
entities.clear();
}

constexpr size_t LENGTH_LIMIT = 35000; // server side limit
Expand Down

0 comments on commit eb98bbe

Please sign in to comment.