Add has_media_timestamps.
This commit is contained in:
parent
9653cc9e3e
commit
2605cd374b
@ -4096,6 +4096,21 @@ void add_formatted_text_dependencies(Dependencies &dependencies, const Formatted
|
||||
}
|
||||
}
|
||||
|
||||
bool has_media_timestamps(const FormattedText *text, int32 min_timestamp, int32 max_timestamp) {
|
||||
if (text == nullptr) {
|
||||
return false;
|
||||
}
|
||||
for (auto &entity : text->entities) {
|
||||
if (entity.type == MessageEntity::Type::MediaTimestamp) {
|
||||
int32 timestamp = to_integer<int32>(entity.argument);
|
||||
if (min_timestamp <= timestamp && timestamp <= max_timestamp) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool has_bot_commands(const FormattedText *text) {
|
||||
if (text == nullptr) {
|
||||
return false;
|
||||
|
@ -196,6 +196,8 @@ Result<FormattedText> process_input_caption(const ContactsManager *contacts_mana
|
||||
|
||||
void add_formatted_text_dependencies(Dependencies &dependencies, const FormattedText *text);
|
||||
|
||||
bool has_media_timestamps(const FormattedText *text, int32 min_timestamp, int32 max_timestamp);
|
||||
|
||||
bool has_bot_commands(const FormattedText *text);
|
||||
|
||||
bool need_always_skip_bot_commands(const ContactsManager *contacts_manager, DialogId dialog_id, bool is_bot);
|
||||
|
Loading…
Reference in New Issue
Block a user