2024-02-26 21:09:52 +01:00
|
|
|
//
|
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
|
|
|
#pragma once
|
|
|
|
|
2024-02-26 23:58:14 +01:00
|
|
|
#include "td/telegram/BusinessAwayMessage.h"
|
2024-02-27 00:07:21 +01:00
|
|
|
#include "td/telegram/BusinessGreetingMessage.h"
|
2024-03-19 12:31:19 +01:00
|
|
|
#include "td/telegram/BusinessIntro.h"
|
2024-02-26 21:09:52 +01:00
|
|
|
#include "td/telegram/BusinessWorkHours.h"
|
|
|
|
#include "td/telegram/DialogLocation.h"
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class Td;
|
|
|
|
|
|
|
|
class BusinessInfo {
|
|
|
|
public:
|
2024-02-26 23:58:14 +01:00
|
|
|
td_api::object_ptr<td_api::businessInfo> get_business_info_object(Td *td) const;
|
2024-02-26 21:09:52 +01:00
|
|
|
|
|
|
|
bool is_empty() const;
|
|
|
|
|
|
|
|
static bool set_location(unique_ptr<BusinessInfo> &business_info, DialogLocation &&location);
|
|
|
|
|
|
|
|
static bool set_work_hours(unique_ptr<BusinessInfo> &business_info, BusinessWorkHours &&work_hours);
|
|
|
|
|
2024-02-26 23:58:14 +01:00
|
|
|
static bool set_away_message(unique_ptr<BusinessInfo> &business_info, BusinessAwayMessage &&away_message);
|
|
|
|
|
2024-02-27 00:07:21 +01:00
|
|
|
static bool set_greeting_message(unique_ptr<BusinessInfo> &business_info, BusinessGreetingMessage &&greeting_message);
|
|
|
|
|
2024-03-19 12:31:19 +01:00
|
|
|
static bool set_intro(unique_ptr<BusinessInfo> &business_info, BusinessIntro &&intro);
|
|
|
|
|
2024-02-26 21:09:52 +01:00
|
|
|
template <class StorerT>
|
|
|
|
void store(StorerT &storer) const;
|
|
|
|
|
|
|
|
template <class ParserT>
|
|
|
|
void parse(ParserT &parser);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static bool is_empty_location(const DialogLocation &location);
|
|
|
|
|
|
|
|
DialogLocation location_;
|
|
|
|
BusinessWorkHours work_hours_;
|
2024-02-26 23:58:14 +01:00
|
|
|
BusinessAwayMessage away_message_;
|
2024-02-27 00:07:21 +01:00
|
|
|
BusinessGreetingMessage greeting_message_;
|
2024-03-19 12:31:19 +01:00
|
|
|
BusinessIntro intro_;
|
2024-02-26 21:09:52 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace td
|