aboutsummaryrefslogtreecommitdiffhomepage
path: root/td/telegram/MessageInputReplyTo.h
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2023-06-08 17:27:24 +0300
committerlevlam <levlam@telegram.org>2023-06-08 17:27:24 +0300
commitfa94abaccb9d1a829c7a813cf3865bdd9d68bfb1 (patch)
tree0a5ecaaaa01eee8a51ea693591e3a340585f8f54 /td/telegram/MessageInputReplyTo.h
parent6116573a3b05749ef137af604886319756821fa7 (diff)
Allow to reply stories.
Diffstat (limited to 'td/telegram/MessageInputReplyTo.h')
-rw-r--r--td/telegram/MessageInputReplyTo.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/td/telegram/MessageInputReplyTo.h b/td/telegram/MessageInputReplyTo.h
new file mode 100644
index 000000000..441a16571
--- /dev/null
+++ b/td/telegram/MessageInputReplyTo.h
@@ -0,0 +1,45 @@
+//
+// 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_;
+
+ bool is_valid() const {
+ return message_id_.is_valid() || story_full_id_.is_valid();
+ }
+
+ MessageInputReplyTo() = default;
+
+ MessageInputReplyTo(MessageId message_id, StoryFullId story_full_id)
+ : message_id_(message_id), story_full_id_(story_full_id) {
+ CHECK(!story_full_id_.is_valid() || !message_id_.is_valid());
+ }
+
+ explicit MessageInputReplyTo(const td_api::object_ptr<td_api::MessageReplyTo> &reply_to_ptr);
+
+ telegram_api::object_ptr<telegram_api::InputReplyTo> get_input_reply_to(Td *td,
+ MessageId top_thread_message_id) const;
+};
+
+StringBuilder &operator<<(StringBuilder &string_builder, const MessageInputReplyTo &input_reply_to);
+
+} // namespace td