Improve spelling.

GitOrigin-RevId: 73edc0a7a57f40c404b4b5c8d00e9b20127f9abc
This commit is contained in:
levlam 2020-05-18 22:54:18 +03:00
parent c13068832b
commit 4c80155092
11 changed files with 34 additions and 34 deletions

View File

@ -136,7 +136,7 @@ StringBuilder &operator<<(StringBuilder &string_builder, const BackgroundType &t
Result<BackgroundType> get_background_type(const td_api::BackgroundType *type) {
if (type == nullptr) {
return Status::Error(400, "Type must not be empty");
return Status::Error(400, "Type must be non-empty");
}
BackgroundType result;
@ -149,7 +149,7 @@ Result<BackgroundType> get_background_type(const td_api::BackgroundType *type) {
case td_api::backgroundTypePattern::ID: {
auto pattern = static_cast<const td_api::backgroundTypePattern *>(type);
if (pattern->fill_ == nullptr) {
return Status::Error(400, "Fill info must not be empty");
return Status::Error(400, "Fill info must be non-empty");
}
result = BackgroundType(pattern->is_moving_, get_background_fill(pattern->fill_.get()), pattern->intensity_);
break;
@ -157,7 +157,7 @@ Result<BackgroundType> get_background_type(const td_api::BackgroundType *type) {
case td_api::backgroundTypeFill::ID: {
auto fill = static_cast<const td_api::backgroundTypeFill *>(type);
if (fill->fill_ == nullptr) {
return Status::Error(400, "Fill info must not be empty");
return Status::Error(400, "Fill info must be non-empty");
}
result = BackgroundType(get_background_fill(fill->fill_.get()));
break;

View File

@ -341,7 +341,7 @@ void InlineQueriesManager::answer_inline_query(int64 inline_query_id, bool is_pe
bool force_vertical = false;
for (auto &input_result : input_results) {
if (input_result == nullptr) {
return promise.set_error(Status::Error(400, "Inline query result must not be empty"));
return promise.set_error(Status::Error(400, "Inline query result must be non-empty"));
}
string id;

View File

@ -1579,7 +1579,7 @@ Result<LanguagePackManager::LanguageInfo> LanguagePackManager::get_language_info
Result<LanguagePackManager::LanguageInfo> LanguagePackManager::get_language_info(
td_api::languagePackInfo *language_pack_info) {
if (language_pack_info == nullptr) {
return Status::Error(400, "Language pack info must not be empty");
return Status::Error(400, "Language pack info must be non-empty");
}
if (!clean_input_string(language_pack_info->id_)) {

View File

@ -47,7 +47,7 @@ static const std::map<Slice, int *> log_tags{
Status Logging::set_current_stream(td_api::object_ptr<td_api::LogStream> stream) {
if (stream == nullptr) {
return Status::Error("Log stream must not be empty");
return Status::Error("Log stream must be non-empty");
}
std::lock_guard<std::mutex> lock(logging_mutex);

View File

@ -1778,7 +1778,7 @@ static Result<InputMessageContent> create_input_message_content(
int32 correct_option_id = -1;
FormattedText explanation;
if (input_poll->type_ == nullptr) {
return Status::Error(400, "Poll type must not be empty");
return Status::Error(400, "Poll type must be non-empty");
}
switch (input_poll->type_->get_id()) {
case td_api::pollTypeRegular::ID: {

View File

@ -7043,7 +7043,7 @@ void MessagesManager::report_dialog(DialogId dialog_id, const tl_object_ptr<td_a
}
if (reason == nullptr) {
return promise.set_error(Status::Error(3, "Reason must not be empty"));
return promise.set_error(Status::Error(3, "Reason must be non-empty"));
}
Dialog *user_d = d;
@ -24694,7 +24694,7 @@ bool MessagesManager::is_dialog_action_unneded(DialogId dialog_id) const {
void MessagesManager::send_dialog_action(DialogId dialog_id, const tl_object_ptr<td_api::ChatAction> &action,
Promise<Unit> &&promise) {
if (action == nullptr) {
return promise.set_error(Status::Error(5, "Action must not be empty"));
return promise.set_error(Status::Error(5, "Action must be non-empty"));
}
if (!have_dialog_force(dialog_id)) {
@ -25256,7 +25256,7 @@ void MessagesManager::set_dialog_permissions(DialogId dialog_id,
}
if (permissions == nullptr) {
return promise.set_error(Status::Error(3, "New permissions must not be empty"));
return promise.set_error(Status::Error(3, "New permissions must be non-empty"));
}
switch (dialog_id.get_type()) {

View File

@ -131,7 +131,7 @@ static int32 get_mute_until(int32 mute_for) {
Result<DialogNotificationSettings> get_dialog_notification_settings(
td_api::object_ptr<td_api::chatNotificationSettings> &&notification_settings, bool old_silent_send_message) {
if (notification_settings == nullptr) {
return Status::Error(400, "New notification settings must not be empty");
return Status::Error(400, "New notification settings must be non-empty");
}
if (!clean_input_string(notification_settings->sound_)) {
return Status::Error(400, "Notification settings sound must be encoded in UTF-8");
@ -155,7 +155,7 @@ Result<DialogNotificationSettings> get_dialog_notification_settings(
Result<ScopeNotificationSettings> get_scope_notification_settings(
td_api::object_ptr<td_api::scopeNotificationSettings> &&notification_settings) {
if (notification_settings == nullptr) {
return Status::Error(400, "New notification settings must not be empty");
return Status::Error(400, "New notification settings must be non-empty");
}
if (!clean_input_string(notification_settings->sound_)) {
return Status::Error(400, "Notification settings sound must be encoded in UTF-8");

View File

@ -647,7 +647,7 @@ static Status check_postal_code(string &postal_code) {
Result<Address> get_address(td_api::object_ptr<td_api::address> &&address) {
if (address == nullptr) {
return Status::Error(400, "Address must not be empty");
return Status::Error(400, "Address must be non-empty");
}
TRY_STATUS(check_country_code(address->country_code_));
TRY_STATUS(check_state(address->state_));
@ -770,7 +770,7 @@ void answer_shipping_query(int64 shipping_query_id, vector<tl_object_ptr<td_api:
vector<tl_object_ptr<telegram_api::shippingOption>> options;
for (auto &option : shipping_options) {
if (option == nullptr) {
return promise.set_error(Status::Error(400, "Shipping option must not be empty"));
return promise.set_error(Status::Error(400, "Shipping option must be non-empty"));
}
if (!clean_input_string(option->id_)) {
return promise.set_error(Status::Error(400, "Shipping option id must be encoded in UTF-8"));
@ -782,7 +782,7 @@ void answer_shipping_query(int64 shipping_query_id, vector<tl_object_ptr<td_api:
vector<tl_object_ptr<telegram_api::labeledPrice>> prices;
for (auto &price_part : option->price_parts_) {
if (price_part == nullptr) {
return promise.set_error(Status::Error(400, "Shipping option price part must not be empty"));
return promise.set_error(Status::Error(400, "Shipping option price part must be non-empty"));
}
if (!clean_input_string(price_part->label_)) {
return promise.set_error(Status::Error(400, "Shipping option price part label must be encoded in UTF-8"));

View File

@ -757,7 +757,7 @@ static Status check_gender(string &gender) {
static Result<string> get_personal_details(td_api::object_ptr<td_api::personalDetails> &&personal_details) {
if (personal_details == nullptr) {
return Status::Error(400, "Personal details must not be empty");
return Status::Error(400, "Personal details must be non-empty");
}
TRY_STATUS(check_name(personal_details->first_name_));
TRY_STATUS(check_name(personal_details->middle_name_));
@ -767,7 +767,7 @@ static Result<string> get_personal_details(td_api::object_ptr<td_api::personalDe
TRY_STATUS(check_name(personal_details->native_last_name_));
TRY_RESULT(birthdate, get_date(std::move(personal_details->birthdate_)));
if (birthdate.empty()) {
return Status::Error(400, "Birthdate must not be empty");
return Status::Error(400, "Birthdate must be non-empty");
}
TRY_STATUS(check_gender(personal_details->gender_));
TRY_STATUS(check_country_code(personal_details->country_code_));
@ -808,7 +808,7 @@ static Result<td_api::object_ptr<td_api::personalDetails>> get_personal_details_
TRY_RESULT(native_last_name, get_json_object_string_field(object, "last_name_native", true));
TRY_RESULT(birthdate, get_json_object_string_field(object, "birth_date", true));
if (birthdate.empty()) {
return Status::Error(400, "Birthdate must not be empty");
return Status::Error(400, "Birthdate must be non-empty");
}
TRY_RESULT(gender, get_json_object_string_field(object, "gender", true));
TRY_RESULT(country_code, get_json_object_string_field(object, "country_code", true));
@ -836,7 +836,7 @@ static Status check_document_number(string &number) {
return Status::Error(400, "Document number must be encoded in UTF-8");
}
if (number.empty()) {
return Status::Error(400, "Document number must not be empty");
return Status::Error(400, "Document number must be non-empty");
}
if (utf8_length(number) > 24) {
return Status::Error(400, "Document number is too long");
@ -867,7 +867,7 @@ static Result<SecureValue> get_identity_document(SecureValueType type, FileManag
td_api::object_ptr<td_api::inputIdentityDocument> &&identity_document,
bool need_reverse_side) {
if (identity_document == nullptr) {
return Status::Error(400, "Identity document must not be empty");
return Status::Error(400, "Identity document must be non-empty");
}
TRY_STATUS(check_document_number(identity_document->number_));
TRY_RESULT(date, get_date(std::move(identity_document->expiry_date_)));
@ -950,7 +950,7 @@ static Result<SecureValue> get_personal_document(
SecureValueType type, FileManager *file_manager,
td_api::object_ptr<td_api::inputPersonalDocument> &&personal_document) {
if (personal_document == nullptr) {
return Status::Error(400, "Personal document must not be empty");
return Status::Error(400, "Personal document must be non-empty");
}
SecureValue res;
@ -988,7 +988,7 @@ static Status check_email_address(string &email_address) {
Result<SecureValue> get_secure_value(FileManager *file_manager,
td_api::object_ptr<td_api::InputPassportElement> &&input_passport_element) {
if (input_passport_element == nullptr) {
return Status::Error(400, "InputPassportElement must not be empty");
return Status::Error(400, "InputPassportElement must be non-empty");
}
SecureValue res;

View File

@ -4170,7 +4170,7 @@ string &StickersManager::get_input_sticker_emojis(td_api::InputSticker *sticker)
Result<std::tuple<FileId, bool, bool, bool>> StickersManager::prepare_input_sticker(td_api::InputSticker *sticker) {
if (sticker == nullptr) {
return Status::Error(3, "Input sticker must not be empty");
return Status::Error(3, "Input sticker must be non-empty");
}
if (!clean_input_string(get_input_sticker_emojis(sticker))) {

View File

@ -5788,7 +5788,7 @@ void Td::on_request(uint64 id, td_api::createCall &request) {
});
if (!request.protocol_) {
return query_promise.set_error(Status::Error(5, "Call protocol must not be empty"));
return query_promise.set_error(Status::Error(5, "Call protocol must be non-empty"));
}
UserId user_id(request.user_id_);
@ -5816,7 +5816,7 @@ void Td::on_request(uint64 id, td_api::acceptCall &request) {
CHECK_IS_USER();
CREATE_OK_REQUEST_PROMISE();
if (!request.protocol_) {
return promise.set_error(Status::Error(5, "Call protocol must not be empty"));
return promise.set_error(Status::Error(5, "Call protocol must be non-empty"));
}
send_closure(G()->call_manager(), &CallManager::accept_call, CallId(request.call_id_),
CallProtocol::from_td_api(*request.protocol_), std::move(promise));
@ -6222,7 +6222,7 @@ void Td::on_request(uint64 id, const td_api::getBlockedUsers &request) {
void Td::on_request(uint64 id, td_api::addContact &request) {
CHECK_IS_USER();
if (request.contact_ == nullptr) {
return send_error_raw(id, 5, "Contact must not be empty");
return send_error_raw(id, 5, "Contact must be non-empty");
}
CLEAN_INPUT_STRING(request.contact_->phone_number_);
CLEAN_INPUT_STRING(request.contact_->first_name_);
@ -6235,7 +6235,7 @@ void Td::on_request(uint64 id, td_api::importContacts &request) {
CHECK_IS_USER();
for (auto &contact : request.contacts_) {
if (contact == nullptr) {
return send_error_raw(id, 5, "Contact must not be empty");
return send_error_raw(id, 5, "Contact must be non-empty");
}
CLEAN_INPUT_STRING(contact->phone_number_);
CLEAN_INPUT_STRING(contact->first_name_);
@ -6269,7 +6269,7 @@ void Td::on_request(uint64 id, td_api::changeImportedContacts &request) {
CHECK_IS_USER();
for (auto &contact : request.contacts_) {
if (contact == nullptr) {
return send_error_raw(id, 5, "Contact must not be empty");
return send_error_raw(id, 5, "Contact must be non-empty");
}
CLEAN_INPUT_STRING(contact->phone_number_);
CLEAN_INPUT_STRING(contact->first_name_);
@ -6588,7 +6588,7 @@ void Td::on_request(uint64 id, const td_api::getChatNotificationSettingsExceptio
void Td::on_request(uint64 id, const td_api::getScopeNotificationSettings &request) {
CHECK_IS_USER();
if (request.scope_ == nullptr) {
return send_error_raw(id, 400, "Scope must not be empty");
return send_error_raw(id, 400, "Scope must be non-empty");
}
CREATE_REQUEST(GetScopeNotificationSettingsRequest, get_notification_settings_scope(request.scope_));
}
@ -6636,7 +6636,7 @@ void Td::on_request(uint64 id, td_api::setChatNotificationSettings &request) {
void Td::on_request(uint64 id, td_api::setScopeNotificationSettings &request) {
CHECK_IS_USER();
if (request.scope_ == nullptr) {
return send_error_raw(id, 400, "Scope must not be empty");
return send_error_raw(id, 400, "Scope must be non-empty");
}
answer_ok_query(id, messages_manager_->set_scope_notification_settings(
get_notification_settings_scope(request.scope_), std::move(request.notification_settings_)));
@ -7180,7 +7180,7 @@ void Td::on_request(uint64 id, td_api::sendPaymentForm &request) {
CLEAN_INPUT_STRING(request.order_info_id_);
CLEAN_INPUT_STRING(request.shipping_option_id_);
if (request.credentials_ == nullptr) {
return send_error_raw(id, 400, "Input payments credentials must not be empty");
return send_error_raw(id, 400, "Input payments credentials must be non-empty");
}
CREATE_REQUEST_PROMISE();
messages_manager_->send_payment_form({DialogId(request.chat_id_), MessageId(request.message_id_)},
@ -7229,7 +7229,7 @@ void Td::on_request(uint64 id, td_api::getPassportElement &request) {
CHECK_IS_USER();
CLEAN_INPUT_STRING(request.password_);
if (request.type_ == nullptr) {
return send_error_raw(id, 400, "Type must not be empty");
return send_error_raw(id, 400, "Type must be non-empty");
}
CREATE_REQUEST_PROMISE();
send_closure(secure_manager_, &SecureManager::get_secure_value, std::move(request.password_),
@ -7259,7 +7259,7 @@ void Td::on_request(uint64 id, td_api::setPassportElement &request) {
void Td::on_request(uint64 id, const td_api::deletePassportElement &request) {
CHECK_IS_USER();
if (request.type_ == nullptr) {
return send_error_raw(id, 400, "Type must not be empty");
return send_error_raw(id, 400, "Type must be non-empty");
}
CREATE_OK_REQUEST_PROMISE();
send_closure(secure_manager_, &SecureManager::delete_secure_value, get_secure_value_type_td_api(request.type_),
@ -7355,7 +7355,7 @@ void Td::on_request(uint64 id, td_api::sendPassportAuthorizationForm &request) {
CHECK_IS_USER();
for (auto &type : request.types_) {
if (type == nullptr) {
return send_error_raw(id, 400, "Type must not be empty");
return send_error_raw(id, 400, "Type must be non-empty");
}
}