aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/BusinessGreetingMessage.cpp
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2024-02-27 02:07:21 +0300
committerlevlam <levlam@telegram.org>2024-02-27 02:07:21 +0300
commit44bdcd492025425e81a4f4b3c10c08b51d8d916b (patch)
treeb558d0236eb42b0f78d6874902596a9fa0e47d0a /td/telegram/BusinessGreetingMessage.cpp
parent74fbe7f549975a82611ed7dcf60be563e07fa66b (diff)
Add businessInfo.greeting_message_settings.
Diffstat (limited to 'td/telegram/BusinessGreetingMessage.cpp')
-rw-r--r--td/telegram/BusinessGreetingMessage.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/td/telegram/BusinessGreetingMessage.cpp b/td/telegram/BusinessGreetingMessage.cpp
index 71bb1ee1a..08967767b 100644
--- a/td/telegram/BusinessGreetingMessage.cpp
+++ b/td/telegram/BusinessGreetingMessage.cpp
@@ -17,10 +17,13 @@
namespace td {
BusinessGreetingMessage::BusinessGreetingMessage(
- telegram_api::object_ptr<telegram_api::businessGreetingMessage> greeting_message)
- : shortcut_id_(greeting_message->shortcut_id_)
- , recipients_(std::move(greeting_message->recipients_))
- , inactivity_days_(clamp(greeting_message->no_activity_days_ / 7 * 7, 7, 28)) {
+ telegram_api::object_ptr<telegram_api::businessGreetingMessage> greeting_message) {
+ if (greeting_message == nullptr) {
+ return;
+ }
+ shortcut_id_ = QuickReplyShortcutId(greeting_message->shortcut_id_);
+ recipients_ = BusinessRecipients(std::move(greeting_message->recipients_));
+ inactivity_days_ = clamp(greeting_message->no_activity_days_ / 7 * 7, 7, 28);
}
BusinessGreetingMessage::BusinessGreetingMessage(
@@ -39,7 +42,7 @@ BusinessGreetingMessage::BusinessGreetingMessage(
td_api::object_ptr<td_api::businessGreetingMessageSettings>
BusinessGreetingMessage::get_business_greeting_message_settings_object(Td *td) const {
- if (!is_valid()) {
+ if (is_empty()) {
return nullptr;
}
return td_api::make_object<td_api::businessGreetingMessageSettings>(