diff --git a/Telegram/CMakeLists.txt b/Telegram/CMakeLists.txt index 7bfcc3227d..4f471492a4 100644 --- a/Telegram/CMakeLists.txt +++ b/Telegram/CMakeLists.txt @@ -180,8 +180,8 @@ set(ayugram_files ayu/features/streamer_mode/platform/streamer_mode_mac.h ayu/features/streamer_mode/streamer_mode.cpp ayu/features/streamer_mode/streamer_mode.h - ayu/features/messageshot/message_shot.cpp - ayu/features/messageshot/message_shot.h + ayu/features/message_shot/message_shot.cpp + ayu/features/message_shot/message_shot.h ayu/features/forward/ayu_forward.cpp ayu/features/forward/ayu_forward.h ayu/features/forward/ayu_sync.cpp diff --git a/Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp b/Telegram/SourceFiles/ayu/features/message_shot/message_shot.cpp similarity index 100% rename from Telegram/SourceFiles/ayu/features/messageshot/message_shot.cpp rename to Telegram/SourceFiles/ayu/features/message_shot/message_shot.cpp diff --git a/Telegram/SourceFiles/ayu/features/messageshot/message_shot.h b/Telegram/SourceFiles/ayu/features/message_shot/message_shot.h similarity index 100% rename from Telegram/SourceFiles/ayu/features/messageshot/message_shot.h rename to Telegram/SourceFiles/ayu/features/message_shot/message_shot.h diff --git a/Telegram/SourceFiles/ayu/ui/boxes/message_shot_box.h b/Telegram/SourceFiles/ayu/ui/boxes/message_shot_box.h index 5cea3d3f5d..3592090e12 100644 --- a/Telegram/SourceFiles/ayu/ui/boxes/message_shot_box.h +++ b/Telegram/SourceFiles/ayu/ui/boxes/message_shot_box.h @@ -6,7 +6,7 @@ // Copyright @Radolyn, 2025 #pragma once -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "ui/layers/box_content.h" class MessageShotBox : public Ui::BoxContent diff --git a/Telegram/SourceFiles/ayu/ui/boxes/theme_selector_box.cpp b/Telegram/SourceFiles/ayu/ui/boxes/theme_selector_box.cpp index b313509f3f..030b095973 100644 --- a/Telegram/SourceFiles/ayu/ui/boxes/theme_selector_box.cpp +++ b/Telegram/SourceFiles/ayu/ui/boxes/theme_selector_box.cpp @@ -7,7 +7,7 @@ #include "theme_selector_box.h" #include "lang_auto.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "data/data_document.h" #include "data/data_document_media.h" #include "data/data_file_origin.h" diff --git a/Telegram/SourceFiles/ayu/ui/components/image_view.cpp b/Telegram/SourceFiles/ayu/ui/components/image_view.cpp index 6e9854c43e..effadcc334 100644 --- a/Telegram/SourceFiles/ayu/ui/components/image_view.cpp +++ b/Telegram/SourceFiles/ayu/ui/components/image_view.cpp @@ -6,7 +6,7 @@ // Copyright @Radolyn, 2025 #include "image_view.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "styles/style_ayu_styles.h" #include "ayu/utils/telegram_helpers.h" diff --git a/Telegram/SourceFiles/ayu/utils/telegram_helpers.cpp b/Telegram/SourceFiles/ayu/utils/telegram_helpers.cpp index 751e5dd50e..1a8f03f946 100644 --- a/Telegram/SourceFiles/ayu/utils/telegram_helpers.cpp +++ b/Telegram/SourceFiles/ayu/utils/telegram_helpers.cpp @@ -37,7 +37,9 @@ #include "ayu/ayu_settings.h" #include "ayu/ayu_state.h" #include "ayu/data/messages_storage.h" +#include "data/data_poll.h" #include "data/data_saved_sublist.h" +#include "main/main_domain.h" namespace { @@ -59,7 +61,7 @@ Main::Session *getSession(ID userId) { return nullptr; } -void dispatchToMainThread(std::function callback, int delay) { +void dispatchToMainThread(const std::function &callback, int delay) { auto timer = new QTimer(); timer->moveToThread(qApp->thread()); timer->setSingleShot(true); @@ -215,19 +217,19 @@ void readReactions(base::weak_ptr weakThread) { } void MarkAsReadThread(not_null thread) { - const auto readHistoryNative = [&](not_null history) + const auto readHistoryNative = [&](const not_null history) { history->owner().histories().readInbox(history); }; const auto sendReadMentions = [=]( - not_null thread) + const not_null threadInner) { - readMentions(base::make_weak(thread)); + readMentions(base::make_weak(threadInner)); }; const auto sendReadReactions = [=]( - not_null thread) + const not_null threadInner) { - readReactions(base::make_weak(thread)); + readReactions(base::make_weak(threadInner)); }; if (thread->chatListBadgesState().unread) { @@ -304,7 +306,7 @@ QString formatTTL(int time) { } QString getDCName(int dc) { - const auto getName = [=](int dc) + const auto getName = [=] { switch (dc) { case 1: @@ -320,7 +322,7 @@ QString getDCName(int dc) { return {"DC_UNKNOWN"}; } - return QString("DC%1, %2").arg(dc).arg(getName(dc)); + return QString("DC%1, %2").arg(dc).arg(getName()); } QString getLocalizedAt() { @@ -435,9 +437,7 @@ QString getMediaName(not_null message) { const auto media = message->media(); - const auto document = media->document(); - - if (document) { + if (const auto document = media->document()) { return document->filename(); } @@ -801,7 +801,7 @@ TextWithTags extractText(not_null item) { return result; } -bool mediaDownloadable(Data::Media *media) { +bool mediaDownloadable(const Data::Media *media) { if (!media || media->webpage() || media->poll() || media->game() || media->invoice() || media->location() || media->paper() diff --git a/Telegram/SourceFiles/ayu/utils/telegram_helpers.h b/Telegram/SourceFiles/ayu/utils/telegram_helpers.h index bf58b06da8..b62c127d45 100644 --- a/Telegram/SourceFiles/ayu/utils/telegram_helpers.h +++ b/Telegram/SourceFiles/ayu/utils/telegram_helpers.h @@ -10,16 +10,14 @@ #include "ayu/data/entities.h" #include "core/application.h" +#include "data/data_media_types.h" #include "dialogs/dialogs_main_list.h" #include "info/profile/info_profile_badge.h" -#include "main/main_domain.h" -#include "data/data_poll.h" -#include "data/data_media_types.h" using UsernameResolverCallback = Fn; Main::Session *getSession(ID userId); -void dispatchToMainThread(std::function callback, int delay = 0); +void dispatchToMainThread(const std::function &callback, int delay = 0); ID getDialogIdFromPeer(not_null peer); ID getBareID(not_null peer); @@ -63,4 +61,4 @@ void searchById(ID userId, Main::Session *session, const UsernameResolverCallbac ID getUserIdFromPackId(uint64 id); TextWithTags extractText(not_null item); -bool mediaDownloadable(Data::Media* media); \ No newline at end of file +bool mediaDownloadable(const Data::Media* media); \ No newline at end of file diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 8267fc32be..301ca58e8d 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -74,7 +74,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" #include "ayu/ayu_state.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "ayu/utils/telegram_helpers.h" diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 9d82d767d0..2c0908a396 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -189,7 +189,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" #include "ayu/utils/telegram_helpers.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "ayu/features/forward/ayu_forward.h" #include "ayu/ui/boxes/message_shot_box.h" #include "boxes/abstract_box.h" diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index 8c489d4c6d..0befc5d329 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -35,7 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "ayu/utils/telegram_helpers.h" #include "core/ui_integration.h" #include "styles/style_ayu_icons.h" diff --git a/Telegram/SourceFiles/history/view/history_view_chat_section.cpp b/Telegram/SourceFiles/history/view/history_view_chat_section.cpp index 72c2c2e58c..279a988e1b 100644 --- a/Telegram/SourceFiles/history/view/history_view_chat_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_chat_section.cpp @@ -89,7 +89,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/history_view_element.cpp b/Telegram/SourceFiles/history/view/history_view_element.cpp index 586c2033df..1cd83f3e22 100644 --- a/Telegram/SourceFiles/history/view/history_view_element.cpp +++ b/Telegram/SourceFiles/history/view/history_view_element.cpp @@ -57,7 +57,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" #include "ayu/ayu_state.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "ayu/utils/telegram_helpers.h" diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 0e2eb5505c..0db7df609f 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -54,7 +54,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "styles/style_ayu_icons.h" diff --git a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp index 16bdd701c1..b996191334 100644 --- a/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_pinned_section.cpp @@ -55,7 +55,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp index f362110b0b..539fb0471f 100644 --- a/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_scheduled_section.cpp @@ -64,7 +64,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp index 802d55e244..1a99393ab3 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_gif.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_gif.cpp @@ -63,7 +63,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp index 73adc03cc6..0501f746c0 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_media_unwrapped.cpp @@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_chat.h" // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp index b67f72b2ee..c82b8ba7bd 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_photo.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_photo.cpp @@ -46,7 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_chat_helpers.h" // AyuGran includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView { diff --git a/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp index d62944cc6b..8e51a668f0 100644 --- a/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp +++ b/Telegram/SourceFiles/history/view/reactions/history_view_reactions.cpp @@ -30,7 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace HistoryView::Reactions { diff --git a/Telegram/SourceFiles/settings/settings_chat.cpp b/Telegram/SourceFiles/settings/settings_chat.cpp index db82693bcc..659e120815 100644 --- a/Telegram/SourceFiles/settings/settings_chat.cpp +++ b/Telegram/SourceFiles/settings/settings_chat.cpp @@ -83,7 +83,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "styles/style_dialogs.h" // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" #include "window/themes/window_theme_preview.h" diff --git a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp index 1fa52d71da..930b136814 100644 --- a/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp +++ b/Telegram/SourceFiles/window/themes/window_themes_cloud_list.cpp @@ -36,7 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace Window { diff --git a/Telegram/SourceFiles/window/themes/window_themes_embedded.cpp b/Telegram/SourceFiles/window/themes/window_themes_embedded.cpp index 3a3c20b84c..f588347bcb 100644 --- a/Telegram/SourceFiles/window/themes/window_themes_embedded.cpp +++ b/Telegram/SourceFiles/window/themes/window_themes_embedded.cpp @@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/style/style_palette_colorizer.h" // AyuGram includes -#include "ayu/features/messageshot/message_shot.h" +#include "ayu/features/message_shot/message_shot.h" namespace Window {