2024-02-26 14:35:20 +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/td_api.h"
|
|
|
|
#include "td/telegram/telegram_api.h"
|
|
|
|
#include "td/telegram/UserId.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
|
|
|
#include "td/utils/StringBuilder.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
2024-03-20 17:26:17 +01:00
|
|
|
class Dependencies;
|
2024-02-26 14:35:20 +01:00
|
|
|
class Td;
|
|
|
|
|
|
|
|
class BusinessRecipients {
|
|
|
|
public:
|
2024-02-26 17:09:58 +01:00
|
|
|
BusinessRecipients() = default;
|
|
|
|
|
2024-02-26 14:35:20 +01:00
|
|
|
explicit BusinessRecipients(telegram_api::object_ptr<telegram_api::businessRecipients> recipients);
|
|
|
|
|
2024-03-07 13:24:28 +01:00
|
|
|
explicit BusinessRecipients(telegram_api::object_ptr<telegram_api::businessBotRecipients> recipients);
|
|
|
|
|
2024-03-20 17:12:35 +01:00
|
|
|
BusinessRecipients(td_api::object_ptr<td_api::businessRecipients> recipients, bool allow_excluded);
|
2024-02-26 14:35:20 +01:00
|
|
|
|
|
|
|
td_api::object_ptr<td_api::businessRecipients> get_business_recipients_object(Td *td) const;
|
|
|
|
|
|
|
|
telegram_api::object_ptr<telegram_api::inputBusinessRecipients> get_input_business_recipients(Td *td) const;
|
|
|
|
|
2024-03-07 13:24:28 +01:00
|
|
|
telegram_api::object_ptr<telegram_api::inputBusinessBotRecipients> get_input_business_bot_recipients(Td *td) const;
|
|
|
|
|
2024-03-20 17:26:17 +01:00
|
|
|
void add_dependencies(Dependencies &dependencies) const;
|
|
|
|
|
2024-02-26 14:35:20 +01:00
|
|
|
template <class StorerT>
|
|
|
|
void store(StorerT &storer) const;
|
|
|
|
|
|
|
|
template <class ParserT>
|
|
|
|
void parse(ParserT &parser);
|
|
|
|
|
|
|
|
private:
|
|
|
|
vector<UserId> user_ids_;
|
2024-03-20 17:12:35 +01:00
|
|
|
vector<UserId> excluded_user_ids_;
|
2024-02-26 14:35:20 +01:00
|
|
|
bool existing_chats_ = false;
|
|
|
|
bool new_chats_ = false;
|
|
|
|
bool contacts_ = false;
|
|
|
|
bool non_contacts_ = false;
|
|
|
|
bool exclude_selected_ = false;
|
|
|
|
|
|
|
|
friend bool operator==(const BusinessRecipients &lhs, const BusinessRecipients &rhs);
|
|
|
|
|
|
|
|
friend StringBuilder &operator<<(StringBuilder &string_builder, const BusinessRecipients &recipients);
|
|
|
|
};
|
|
|
|
|
|
|
|
bool operator==(const BusinessRecipients &lhs, const BusinessRecipients &rhs);
|
|
|
|
|
|
|
|
inline bool operator!=(const BusinessRecipients &lhs, const BusinessRecipients &rhs) {
|
|
|
|
return !(lhs == rhs);
|
|
|
|
}
|
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, const BusinessRecipients &recipients);
|
|
|
|
|
|
|
|
} // namespace td
|