Implement hash function for MessageContentType enum. (#1283)
This commit is contained in:
parent
e4dda41a98
commit
645052bec7
@ -70,4 +70,10 @@ bool is_service_message_content(MessageContentType content_type);
|
||||
|
||||
bool can_have_message_content_caption(MessageContentType content_type);
|
||||
|
||||
struct MessageContentTypeHash {
|
||||
std::size_t operator()(MessageContentType content_type) const {
|
||||
return std::hash<int32>()(static_cast<int32>(content_type));
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace td
|
||||
|
@ -22961,7 +22961,7 @@ Result<vector<MessageId>> MessagesManager::send_message_group(
|
||||
TRY_RESULT(message_send_options, process_message_send_options(dialog_id, std::move(options)));
|
||||
|
||||
vector<std::pair<unique_ptr<MessageContent>, int32>> message_contents;
|
||||
std::unordered_set<MessageContentType> message_content_types;
|
||||
std::unordered_set<MessageContentType, MessageContentTypeHash> message_content_types;
|
||||
for (auto &input_message_content : input_message_contents) {
|
||||
TRY_RESULT(message_content, process_input_message_content(dialog_id, std::move(input_message_content)));
|
||||
TRY_STATUS(can_use_message_send_options(message_send_options, message_content));
|
||||
|
Loading…
Reference in New Issue
Block a user