tdlight/td/telegram/BusinessInfo.h

61 lines
1.8 KiB
C
Raw Normal View History

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
#include "td/telegram/BusinessAwayMessage.h"
#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"
2024-03-20 17:40:10 +01:00
#include "td/telegram/files/FileId.h"
2024-02-26 21:09:52 +01:00
#include "td/telegram/td_api.h"
#include "td/utils/common.h"
namespace td {
2024-03-20 17:26:17 +01:00
class Dependencies;
2024-02-26 21:09:52 +01:00
class Td;
class BusinessInfo {
public:
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);
static bool set_away_message(unique_ptr<BusinessInfo> &business_info, BusinessAwayMessage &&away_message);
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-03-20 17:26:17 +01:00
void add_dependencies(Dependencies &dependencies) const;
2024-03-20 17:40:10 +01:00
vector<FileId> get_file_ids(const Td *td) const;
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_;
BusinessAwayMessage away_message_;
BusinessGreetingMessage greeting_message_;
2024-03-19 12:31:19 +01:00
BusinessIntro intro_;
2024-02-26 21:09:52 +01:00
};
} // namespace td