tdlight/td/telegram/MessageInputReplyTo.h

63 lines
1.8 KiB
C
Raw Normal View History

2023-06-08 16:27:24 +02:00
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2023
//
// 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/MessageId.h"
#include "td/telegram/StoryFullId.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
namespace td {
class Td;
struct MessageInputReplyTo {
MessageId message_id_;
// or
StoryFullId story_full_id_;
2023-10-24 14:02:57 +02:00
friend bool operator==(const MessageInputReplyTo &lhs, const MessageInputReplyTo &rhs);
2023-06-08 16:27:24 +02:00
MessageInputReplyTo() = default;
explicit MessageInputReplyTo(MessageId message_id) : message_id_(message_id) {
2023-06-08 16:27:24 +02:00
}
explicit MessageInputReplyTo(StoryFullId story_full_id) : story_full_id_(story_full_id) {
}
2023-06-08 16:27:24 +02:00
2023-10-24 14:02:57 +02:00
bool is_empty() const {
return !message_id_.is_valid() && !story_full_id_.is_valid();
}
bool is_valid() const {
return !is_empty();
}
2023-06-08 16:27:24 +02:00
telegram_api::object_ptr<telegram_api::InputReplyTo> get_input_reply_to(Td *td,
MessageId top_thread_message_id) const;
2023-10-24 14:02:57 +02:00
td_api::object_ptr<td_api::InputMessageReplyTo> get_input_message_reply_to_object(Td *td, DialogId dialog_id) const;
template <class StorerT>
void store(StorerT &storer) const;
template <class ParserT>
void parse(ParserT &parser);
2023-06-08 16:27:24 +02:00
};
2023-10-24 14:02:57 +02:00
bool operator==(const MessageInputReplyTo &lhs, const MessageInputReplyTo &rhs);
bool operator!=(const MessageInputReplyTo &lhs, const MessageInputReplyTo &rhs);
2023-06-08 16:27:24 +02:00
StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReplyTo &input_reply_to);
} // namespace td