diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 5e4232fdb..529fa49cb 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -581,8 +581,8 @@ chatLocation location:location address:string = ChatLocation; //@description Send away messages if the account was online more than 10 minutes businessAwayMessageScheduleOffline = BusinessAwayMessageSchedule; -//@description Send away messages outside of the business work hours -businessAwayMessageScheduleOutsideOfWorkHours = BusinessAwayMessageSchedule; +//@description Send away messages outside of the business opening hours +businessAwayMessageScheduleOutsideOfOpeningHours = BusinessAwayMessageSchedule; //@description Send away messages only in the specified time span //@start_date Point in time (Unix timestamp) when the away messages will start to be sent @@ -617,17 +617,17 @@ businessGreetingMessageSettings shortcut_id:int32 recipients:businessRecipients //@description Describes an interval of time when the business is open //@start_minute The first minute of the interval since start of the week; 0-7*24*60 //@end_minute The first minute after the end of the interval since start of the week; 1-8*24*60 -businessWorkHoursInterval start_minute:int32 end_minute:int32 = BusinessWorkHoursInterval; +businessOpeningHoursInterval start_minute:int32 end_minute:int32 = BusinessOpeningHoursInterval; -//@description Describes work hours of a business @time_zone_id Unique time zone identifier @work_hours Intervals of the time when the business is open -businessWorkHours time_zone_id:string work_hours:vector = BusinessWorkHours; +//@description Describes opening hours of a business @time_zone_id Unique time zone identifier @opening_hours Intervals of the time when the business is open +businessOpeningHours time_zone_id:string opening_hours:vector = BusinessOpeningHours; //@description Contains information about a Telegram Business account //@location Location of the business; may be null if none -//@work_hours Work hours of the business; may be null if none +//@opening_hours Opening hours of the business; may be null if none //@greeting_message_settings The greeting message; may be null if none or the Business account is not of the current user //@away_message_settings The away message; may be null if none or the Business account is not of the current user -businessInfo location:businessLocation work_hours:businessWorkHours greeting_message_settings:businessGreetingMessageSettings away_message_settings:businessAwayMessageSettings = BusinessInfo; +businessInfo location:businessLocation opening_hours:businessOpeningHours greeting_message_settings:businessGreetingMessageSettings away_message_settings:businessAwayMessageSettings = BusinessInfo; //@class ChatPhotoStickerType @description Describes type of a sticker, which was used to create a chat photo @@ -9350,8 +9350,8 @@ setLocation location:location = Ok; //@description Changes the business location of the current user. Requires Telegram Business subscription @location The new location of the business; pass null to remove the location setBusinessLocation location:businessLocation = Ok; -//@description Changes the business work hours of the current user. Requires Telegram Business subscription @work_hours The new work hours of the business; pass null to remove the work hours -setBusinessWorkHours work_hours:businessWorkHours = Ok; +//@description Changes the business opening hours of the current user. Requires Telegram Business subscription @opening_hours The new opening hours of the business; pass null to remove the opening hours +setBusinessOpeningHours opening_hours:businessOpeningHours = Ok; //@description Changes the business greeting message settings of the current user. Requires Telegram Business subscription @greeting_message_settings The new settings for the greeting message of the business; pass null to disable the greeting message setBusinessGreetingMessageSettings greeting_message_settings:businessGreetingMessageSettings = Ok; diff --git a/td/telegram/BusinessAwayMessageSchedule.cpp b/td/telegram/BusinessAwayMessageSchedule.cpp index 11b62973b..6cc6ce574 100644 --- a/td/telegram/BusinessAwayMessageSchedule.cpp +++ b/td/telegram/BusinessAwayMessageSchedule.cpp @@ -39,7 +39,7 @@ BusinessAwayMessageSchedule::BusinessAwayMessageSchedule( case td_api::businessAwayMessageScheduleOffline::ID: type_ = Type::Offline; break; - case td_api::businessAwayMessageScheduleOutsideOfWorkHours::ID: + case td_api::businessAwayMessageScheduleOutsideOfOpeningHours::ID: type_ = Type::OutsideOfWorkHours; break; case td_api::businessAwayMessageScheduleCustom::ID: { @@ -60,7 +60,7 @@ BusinessAwayMessageSchedule::get_business_away_message_schedule_object() const { case Type::Offline: return td_api::make_object(); case Type::OutsideOfWorkHours: - return td_api::make_object(); + return td_api::make_object(); case Type::Custom: return td_api::make_object(start_date_, end_date_); default: diff --git a/td/telegram/BusinessInfo.cpp b/td/telegram/BusinessInfo.cpp index 801be0e8c..9cf379aae 100644 --- a/td/telegram/BusinessInfo.cpp +++ b/td/telegram/BusinessInfo.cpp @@ -10,7 +10,7 @@ namespace td { td_api::object_ptr BusinessInfo::get_business_info_object(Td *td) const { return td_api::make_object(location_.get_business_location_object(), - work_hours_.get_business_work_hours_object(), + work_hours_.get_business_opening_hours_object(), greeting_message_.get_business_greeting_message_settings_object(td), away_message_.get_business_away_message_settings_object(td)); } diff --git a/td/telegram/BusinessWorkHours.cpp b/td/telegram/BusinessWorkHours.cpp index 81aecc7cf..59728587d 100644 --- a/td/telegram/BusinessWorkHours.cpp +++ b/td/telegram/BusinessWorkHours.cpp @@ -11,9 +11,9 @@ namespace td { -td_api::object_ptr -BusinessWorkHours::WorkHoursInterval::get_business_work_hours_interval_object() const { - return td_api::make_object(start_minute_, end_minute_); +td_api::object_ptr +BusinessWorkHours::WorkHoursInterval::get_business_opening_hours_interval_object() const { + return td_api::make_object(start_minute_, end_minute_); } telegram_api::object_ptr @@ -31,12 +31,12 @@ BusinessWorkHours::BusinessWorkHours(telegram_api::object_ptr &&work_hours) { +BusinessWorkHours::BusinessWorkHours(td_api::object_ptr &&work_hours) { if (work_hours != nullptr) { - work_hours_ = - transform(work_hours->work_hours_, [](const td_api::object_ptr &interval) { - return WorkHoursInterval(interval->start_minute_, interval->end_minute_); - }); + work_hours_ = transform(work_hours->opening_hours_, + [](const td_api::object_ptr &interval) { + return WorkHoursInterval(interval->start_minute_, interval->end_minute_); + }); time_zone_id_ = std::move(work_hours->time_zone_id_); } } @@ -45,14 +45,14 @@ bool BusinessWorkHours::is_empty() const { return work_hours_.empty(); } -td_api::object_ptr BusinessWorkHours::get_business_work_hours_object() const { +td_api::object_ptr BusinessWorkHours::get_business_opening_hours_object() const { if (is_empty()) { return nullptr; } - return td_api::make_object(time_zone_id_, - transform(work_hours_, [](const WorkHoursInterval &interval) { - return interval.get_business_work_hours_interval_object(); - })); + return td_api::make_object( + time_zone_id_, transform(work_hours_, [](const WorkHoursInterval &interval) { + return interval.get_business_opening_hours_interval_object(); + })); } telegram_api::object_ptr BusinessWorkHours::get_input_business_work_hours() const { diff --git a/td/telegram/BusinessWorkHours.h b/td/telegram/BusinessWorkHours.h index ccdcb80f3..a14f3ee57 100644 --- a/td/telegram/BusinessWorkHours.h +++ b/td/telegram/BusinessWorkHours.h @@ -22,11 +22,11 @@ class BusinessWorkHours { explicit BusinessWorkHours(telegram_api::object_ptr &&work_hours); - explicit BusinessWorkHours(td_api::object_ptr &&work_hours); + explicit BusinessWorkHours(td_api::object_ptr &&work_hours); bool is_empty() const; - td_api::object_ptr get_business_work_hours_object() const; + td_api::object_ptr get_business_opening_hours_object() const; telegram_api::object_ptr get_input_business_work_hours() const; @@ -45,7 +45,7 @@ class BusinessWorkHours { WorkHoursInterval(int32 start_minute, int32 end_minute) : start_minute_(start_minute), end_minute_(end_minute) { } - td_api::object_ptr get_business_work_hours_interval_object() const; + td_api::object_ptr get_business_opening_hours_interval_object() const; telegram_api::object_ptr get_input_business_weekly_open() const; diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 1eca9d392..639eb4577 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -7773,10 +7773,10 @@ void Td::on_request(uint64 id, td_api::setBusinessLocation &request) { contacts_manager_->set_business_location(DialogLocation(std::move(request.location_)), std::move(promise)); } -void Td::on_request(uint64 id, td_api::setBusinessWorkHours &request) { +void Td::on_request(uint64 id, td_api::setBusinessOpeningHours &request) { CHECK_IS_USER(); CREATE_OK_REQUEST_PROMISE(); - contacts_manager_->set_business_work_hours(BusinessWorkHours(std::move(request.work_hours_)), std::move(promise)); + contacts_manager_->set_business_work_hours(BusinessWorkHours(std::move(request.opening_hours_)), std::move(promise)); } void Td::on_request(uint64 id, td_api::setBusinessGreetingMessageSettings &request) { diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 829c49f66..b16213f4b 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -1378,7 +1378,7 @@ class Td final : public Actor { void on_request(uint64 id, td_api::setBusinessLocation &request); - void on_request(uint64 id, td_api::setBusinessWorkHours &request); + void on_request(uint64 id, td_api::setBusinessOpeningHours &request); void on_request(uint64 id, td_api::setBusinessGreetingMessageSettings &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 832a8d264..5ddfbc6c5 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -5921,23 +5921,23 @@ class CliClient final : public Actor { send_request(td_api::make_object(td_api::make_object( longitude.empty() ? nullptr : as_location(latitude, longitude, string()), "business address"))); } - } else if (op == "sbwh") { + } else if (op == "sboh") { string time_zone_id; - string work_hours; - get_args(args, time_zone_id, work_hours); + string opening_hours; + get_args(args, time_zone_id, opening_hours); if (time_zone_id.empty()) { - send_request(td_api::make_object(nullptr)); + send_request(td_api::make_object(nullptr)); } else { - auto minutes = to_integers(work_hours); + auto minutes = to_integers(opening_hours); if (minutes.size() % 2 == 1) { minutes.push_back(8 * 24 * 60); } - vector> intervals; + vector> intervals; for (size_t i = 0; i < minutes.size(); i += 2) { - intervals.push_back(td_api::make_object(minutes[i], minutes[i + 1])); + intervals.push_back(td_api::make_object(minutes[i], minutes[i + 1])); } - send_request(td_api::make_object( - td_api::make_object(time_zone_id, std::move(intervals)))); + send_request(td_api::make_object( + td_api::make_object(time_zone_id, std::move(intervals)))); } } else if (op == "sbgms") { string shortcut_id; @@ -5966,7 +5966,7 @@ class CliClient final : public Actor { if (schedule[0] == 'o') { schedule_object = td_api::make_object(); } else if (schedule[0] == 'h') { - schedule_object = td_api::make_object(); + schedule_object = td_api::make_object(); } else { auto start_date = to_integer(schedule); schedule_object = td_api::make_object(