2022-10-18 20:44:52 +02:00
|
|
|
//
|
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
|
|
|
//
|
|
|
|
// 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/CustomEmojiId.h"
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
|
|
|
#include "td/utils/common.h"
|
|
|
|
#include "td/utils/StringBuilder.h"
|
|
|
|
|
|
|
|
namespace td {
|
|
|
|
|
|
|
|
class ForumTopicEditedData {
|
|
|
|
string title_;
|
|
|
|
CustomEmojiId icon_custom_emoji_id_;
|
|
|
|
bool edit_icon_custom_emoji_id_ = false;
|
|
|
|
bool edit_is_closed_ = false;
|
|
|
|
bool is_closed_ = false;
|
2022-11-30 13:39:29 +01:00
|
|
|
bool edit_is_hidden_ = false;
|
|
|
|
bool is_hidden_ = false;
|
2022-10-18 20:44:52 +02:00
|
|
|
|
2022-10-18 21:16:03 +02:00
|
|
|
friend bool operator==(const ForumTopicEditedData &lhs, const ForumTopicEditedData &rhs);
|
|
|
|
|
2022-10-18 20:44:52 +02:00
|
|
|
friend StringBuilder &operator<<(StringBuilder &string_builder, const ForumTopicEditedData &topic_edited_data);
|
|
|
|
|
2022-10-27 18:03:58 +02:00
|
|
|
friend class ForumTopicInfo;
|
|
|
|
|
2022-10-18 20:44:52 +02:00
|
|
|
public:
|
|
|
|
ForumTopicEditedData() = default;
|
|
|
|
|
|
|
|
ForumTopicEditedData(string &&title, bool edit_icon_custom_emoji_id, int64 icon_custom_emoji_id, bool edit_is_closed,
|
2022-11-30 13:39:29 +01:00
|
|
|
bool is_closed, bool edit_is_hidden, bool is_hidden)
|
2022-10-18 20:44:52 +02:00
|
|
|
: title_(std::move(title))
|
|
|
|
, icon_custom_emoji_id_(icon_custom_emoji_id)
|
|
|
|
, edit_icon_custom_emoji_id_(edit_icon_custom_emoji_id)
|
|
|
|
, edit_is_closed_(edit_is_closed)
|
2022-11-30 13:39:29 +01:00
|
|
|
, is_closed_(is_closed)
|
|
|
|
, edit_is_hidden_(edit_is_hidden)
|
|
|
|
, is_hidden_(is_hidden) {
|
2022-10-18 20:44:52 +02:00
|
|
|
}
|
|
|
|
|
2022-11-17 11:22:24 +01:00
|
|
|
bool is_empty() const {
|
2022-11-30 13:39:29 +01:00
|
|
|
return title_.empty() && !edit_icon_custom_emoji_id_ && !edit_is_closed_ && !edit_is_hidden_;
|
2022-11-17 11:22:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const string &get_title() const {
|
|
|
|
return title_;
|
|
|
|
}
|
|
|
|
|
2022-10-27 18:40:37 +02:00
|
|
|
td_api::object_ptr<td_api::MessageContent> get_message_content_object() const;
|
2022-10-18 21:16:03 +02:00
|
|
|
|
|
|
|
template <class StorerT>
|
|
|
|
void store(StorerT &storer) const;
|
|
|
|
|
|
|
|
template <class ParserT>
|
|
|
|
void parse(ParserT &parser);
|
2022-10-18 20:44:52 +02:00
|
|
|
};
|
|
|
|
|
2022-10-18 21:16:03 +02:00
|
|
|
bool operator==(const ForumTopicEditedData &lhs, const ForumTopicEditedData &rhs);
|
|
|
|
bool operator!=(const ForumTopicEditedData &lhs, const ForumTopicEditedData &rhs);
|
|
|
|
|
2022-10-18 20:44:52 +02:00
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, const ForumTopicEditedData &topic_edited_data);
|
|
|
|
|
|
|
|
} // namespace td
|