fix merge conflicts

This commit is contained in:
a5r0n 2023-12-16 22:29:04 +02:00
parent c24c0a2dae
commit a35ff4543b
No known key found for this signature in database
GPG Key ID: 2D8D4CB7D7EA9A53
3 changed files with 14 additions and 14 deletions

View File

@ -8530,26 +8530,26 @@ td::int64 Client::get_int64_arg(const Query *query, td::Slice field_name, int64
return td::clamp(td::to_integer<int64>(s_arg), min_value, max_value); return td::clamp(td::to_integer<int64>(s_arg), min_value, max_value);
} }
td::Result<td_api::object_ptr<td_api::ChatReportReason>> Client::get_report_reason(const Query *query, td::Result<td_api::object_ptr<td_api::ReportReason>> Client::get_report_reason(const Query *query,
td::Slice field_name) { td::Slice field_name) {
auto reason = query->arg(field_name); auto reason = query->arg(field_name);
object_ptr<td_api::ChatReportReason> result; object_ptr<td_api::ReportReason> result;
if (reason.empty()) { if (reason.empty()) {
return td::Status::Error(400, "reason is not specified"); return td::Status::Error(400, "reason is not specified");
} else if (reason == "child_abuse") { } else if (reason == "child_abuse") {
result = make_object<td_api::chatReportReasonChildAbuse>(); result = make_object<td_api::reportReasonChildAbuse>();
} else if (reason == "copyright") { } else if (reason == "copyright") {
result = make_object<td_api::chatReportReasonCopyright>(); result = make_object<td_api::reportReasonCopyright>();
} else if (reason == "pornography") { } else if (reason == "pornography") {
result = make_object<td_api::chatReportReasonPornography>(); result = make_object<td_api::reportReasonPornography>();
} else if (reason == "spam") { } else if (reason == "spam") {
result = make_object<td_api::chatReportReasonSpam>(); result = make_object<td_api::reportReasonSpam>();
} else if (reason == "unrelated_location") { } else if (reason == "unrelated_location") {
result = make_object<td_api::chatReportReasonUnrelatedLocation>(); result = make_object<td_api::reportReasonUnrelatedLocation>();
} else if (reason == "violence") { } else if (reason == "violence") {
result = make_object<td_api::chatReportReasonViolence>(); result = make_object<td_api::reportReasonViolence>();
} else { } else {
result = make_object<td_api::chatReportReasonCustom>(); result = make_object<td_api::reportReasonCustom>();
} }
return std::move(result); return std::move(result);
} }
@ -9232,7 +9232,7 @@ td::Status Client::process_send_media_group_query(PromisedQueryPtr &query) {
send_request( send_request(
make_object<td_api::sendMessageAlbum>( make_object<td_api::sendMessageAlbum>(
chat_id, message_thread_id, get_input_message_reply_to(reply_to_message_id), chat_id, message_thread_id, get_input_message_reply_to(reply_to_message_id),
get_message_send_options(disable_notification, protect_content), std::move(input_message_contents)), get_message_send_options(disable_notification, protect_content, std::move(send_at)), std::move(input_message_contents)),
td::make_unique<TdOnSendMessageAlbumCallback>(this, chat_id, message_count, std::move(query))); td::make_unique<TdOnSendMessageAlbumCallback>(this, chat_id, message_count, std::move(query)));
}; };
check_message_thread(chat_id, message_thread_id, reply_to_message_id, std::move(query), check_message_thread(chat_id, message_thread_id, reply_to_message_id, std::move(query),
@ -10972,7 +10972,7 @@ td::Status Client::process_report_chat_query(PromisedQueryPtr &query) {
[this, reason = std::move(reason), message_ids = std::move(message_ids)](int64 chat_id, [this, reason = std::move(reason), message_ids = std::move(message_ids)](int64 chat_id,
PromisedQueryPtr query) mutable { PromisedQueryPtr query) mutable {
send_request(make_object<td_api::reportChat>(chat_id, std::move(message_ids), std::move(reason), reason->get_id() == td_api::chatReportReasonCustom::ID ? query->arg("reason").str() : td::string()), send_request(make_object<td_api::reportChat>(chat_id, std::move(message_ids), std::move(reason), reason->get_id() == td_api::reportReasonCustom::ID ? query->arg("reason").str() : td::string()),
td::make_unique<TdOnOkQueryCallback>(std::move(query))); td::make_unique<TdOnOkQueryCallback>(std::move(query)));
}); });
return td::Status::OK(); return td::Status::OK();

View File

@ -560,7 +560,7 @@ class Client final : public WebhookActor::Callback {
static int64 get_int64_arg(const Query *query, td::Slice field_name, int64 default_value, static int64 get_int64_arg(const Query *query, td::Slice field_name, int64 default_value,
int64 min_value = std::numeric_limits<int64>::min(), int64 min_value = std::numeric_limits<int64>::min(),
int64 max_value = std::numeric_limits<int64>::max()); int64 max_value = std::numeric_limits<int64>::max());
static td::Result<td_api::object_ptr<td_api::ChatReportReason>> get_report_reason(const Query *query, static td::Result<td_api::object_ptr<td_api::ReportReason>> get_report_reason(const Query *query,
td::Slice field_name = td::Slice("reason")); td::Slice field_name = td::Slice("reason"));
static td::Result<td_api::object_ptr<td_api::SearchMessagesFilter>> get_search_messages_filter( static td::Result<td_api::object_ptr<td_api::SearchMessagesFilter>> get_search_messages_filter(

View File

@ -496,13 +496,13 @@ void ClientManager::start_up() {
parameters_->shared_data_->webhook_db_ = std::move(concurrent_webhook_db); parameters_->shared_data_->webhook_db_ = std::move(concurrent_webhook_db);
auto concurrent_user_db = td::make_unique<td::BinlogKeyValue<td::ConcurrentBinlog>>(); auto concurrent_user_db = td::make_unique<td::BinlogKeyValue<td::ConcurrentBinlog>>();
status = concurrent_user_db->init(parameters_->working_directory_ + "user_db.binlog", td::DbKey::empty(), scheduler_id); status = concurrent_user_db->init(parameters_->working_directory_ + "user_db.binlog", td::DbKey::empty(), SharedData::get_binlog_scheduler_id());
LOG_IF(FATAL, status.is_error()) << "Can't open user_db.binlog " << status.error(); LOG_IF(FATAL, status.is_error()) << "Can't open user_db.binlog " << status.error();
parameters_->shared_data_->user_db_ = std::move(concurrent_user_db); parameters_->shared_data_->user_db_ = std::move(concurrent_user_db);
auto &webhook_db = *parameters_->shared_data_->webhook_db_; auto &webhook_db = *parameters_->shared_data_->webhook_db_;
auto &user_db = *parameters_->shared_data_->user_db_; auto &user_db = *parameters_->shared_data_->user_db_;
for (const auto key_value : webhook_db.get_all()) { for (const auto &key_value : webhook_db.get_all()) {
if (!token_range_(td::to_integer<td::uint64>(key_value.first))) { if (!token_range_(td::to_integer<td::uint64>(key_value.first))) {
LOG(WARNING) << "DROP WEBHOOK: " << key_value.first << " ---> " << key_value.second; LOG(WARNING) << "DROP WEBHOOK: " << key_value.first << " ---> " << key_value.second;
webhook_db.erase(key_value.first); webhook_db.erase(key_value.first);