diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index c487387cf5..85aed68e25 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -474,6 +474,7 @@ PRIVATE history/admin_log/history_admin_log_section.h # history/feed/history_feed_section.cpp # history/feed/history_feed_section.h + history/view/controls/compose_controls_common.h history/view/controls/history_view_compose_controls.cpp history/view/controls/history_view_compose_controls.h history/view/media/history_view_call.h diff --git a/Telegram/SourceFiles/history/view/controls/compose_controls_common.h b/Telegram/SourceFiles/history/view/controls/compose_controls_common.h new file mode 100644 index 0000000000..d34621c1e5 --- /dev/null +++ b/Telegram/SourceFiles/history/view/controls/compose_controls_common.h @@ -0,0 +1,42 @@ +/* +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. + +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +namespace Api { +enum class SendProgressType; +struct SendOptions; +} // namespace Api + +class History; + +namespace HistoryView::Controls { + +struct MessageToEdit { + FullMsgId fullId; + Api::SendOptions options; + TextWithTags textWithTags; +}; +struct VoiceToSend { + QByteArray bytes; + VoiceWaveform waveform; + int duration = 0; +}; +struct SendActionUpdate { + Api::SendProgressType type = Api::SendProgressType(); + int progress = 0; +}; + +struct SetHistoryArgs { + required history; + Fn showSlowmodeError; + rpl::producer slowmodeSecondsLeft; + rpl::producer sendDisabledBySlowmode; + rpl::producer> writeRestriction; +}; + +} // namespace HistoryView::Controls diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index 7648e7344e..0020e99446 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -56,6 +56,7 @@ using PhotoChosen = ComposeControls::PhotoChosen; using MessageToEdit = ComposeControls::MessageToEdit; using VoiceToSend = ComposeControls::VoiceToSend; using SendActionUpdate = ComposeControls::SendActionUpdate; +using SetHistoryArgs = ComposeControls::SetHistoryArgs; [[nodiscard]] auto ShowWebPagePreview(WebPageData *page) { return page && (page->pendingTill >= 0); diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h index 6b1b2f0a1a..0bea191060 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.h @@ -10,6 +10,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/required.h" #include "api/api_common.h" #include "base/unique_qptr.h" +#include "history/view/controls/compose_controls_common.h" #include "ui/rp_widget.h" #include "ui/effects/animations.h" #include "ui/widgets/input_fields.h" @@ -61,26 +62,17 @@ class ComposeControls final { public: using FileChosen = ChatHelpers::TabbedSelector::FileChosen; using PhotoChosen = ChatHelpers::TabbedSelector::PhotoChosen; + + using MessageToEdit = Controls::MessageToEdit; + using VoiceToSend = Controls::VoiceToSend; + using SendActionUpdate = Controls::SendActionUpdate; + using SetHistoryArgs = Controls::SetHistoryArgs; + enum class Mode { Normal, Scheduled, }; - struct MessageToEdit { - FullMsgId fullId; - Api::SendOptions options; - TextWithTags textWithTags; - }; - struct VoiceToSend { - QByteArray bytes; - VoiceWaveform waveform; - int duration = 0; - }; - struct SendActionUpdate { - Api::SendProgressType type = Api::SendProgressType(); - int progress = 0; - }; - ComposeControls( not_null parent, not_null window, @@ -88,14 +80,6 @@ public: ~ComposeControls(); [[nodiscard]] Main::Session &session() const; - - struct SetHistoryArgs { - required history; - Fn showSlowmodeError; - rpl::producer slowmodeSecondsLeft; - rpl::producer sendDisabledBySlowmode; - rpl::producer> writeRestriction; - }; void setHistory(SetHistoryArgs &&args); void finishAnimating();