mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-09-30 07:35:32 +02:00
chore: rename messageshot
folder & fix some warnings
This commit is contained in:
parent
dfb9ac91e9
commit
4a46207fa5
23 changed files with 35 additions and 37 deletions
|
@ -180,8 +180,8 @@ set(ayugram_files
|
||||||
ayu/features/streamer_mode/platform/streamer_mode_mac.h
|
ayu/features/streamer_mode/platform/streamer_mode_mac.h
|
||||||
ayu/features/streamer_mode/streamer_mode.cpp
|
ayu/features/streamer_mode/streamer_mode.cpp
|
||||||
ayu/features/streamer_mode/streamer_mode.h
|
ayu/features/streamer_mode/streamer_mode.h
|
||||||
ayu/features/messageshot/message_shot.cpp
|
ayu/features/message_shot/message_shot.cpp
|
||||||
ayu/features/messageshot/message_shot.h
|
ayu/features/message_shot/message_shot.h
|
||||||
ayu/features/forward/ayu_forward.cpp
|
ayu/features/forward/ayu_forward.cpp
|
||||||
ayu/features/forward/ayu_forward.h
|
ayu/features/forward/ayu_forward.h
|
||||||
ayu/features/forward/ayu_sync.cpp
|
ayu/features/forward/ayu_sync.cpp
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// Copyright @Radolyn, 2025
|
// Copyright @Radolyn, 2025
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
#include "ui/layers/box_content.h"
|
#include "ui/layers/box_content.h"
|
||||||
|
|
||||||
class MessageShotBox : public Ui::BoxContent
|
class MessageShotBox : public Ui::BoxContent
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include "theme_selector_box.h"
|
#include "theme_selector_box.h"
|
||||||
|
|
||||||
#include "lang_auto.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.h"
|
||||||
#include "data/data_document_media.h"
|
#include "data/data_document_media.h"
|
||||||
#include "data/data_file_origin.h"
|
#include "data/data_file_origin.h"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// Copyright @Radolyn, 2025
|
// Copyright @Radolyn, 2025
|
||||||
#include "image_view.h"
|
#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 "styles/style_ayu_styles.h"
|
||||||
|
|
||||||
#include "ayu/utils/telegram_helpers.h"
|
#include "ayu/utils/telegram_helpers.h"
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/ayu_state.h"
|
#include "ayu/ayu_state.h"
|
||||||
#include "ayu/data/messages_storage.h"
|
#include "ayu/data/messages_storage.h"
|
||||||
|
#include "data/data_poll.h"
|
||||||
#include "data/data_saved_sublist.h"
|
#include "data/data_saved_sublist.h"
|
||||||
|
#include "main/main_domain.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
@ -59,7 +61,7 @@ Main::Session *getSession(ID userId) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dispatchToMainThread(std::function<void()> callback, int delay) {
|
void dispatchToMainThread(const std::function<void()> &callback, int delay) {
|
||||||
auto timer = new QTimer();
|
auto timer = new QTimer();
|
||||||
timer->moveToThread(qApp->thread());
|
timer->moveToThread(qApp->thread());
|
||||||
timer->setSingleShot(true);
|
timer->setSingleShot(true);
|
||||||
|
@ -215,19 +217,19 @@ void readReactions(base::weak_ptr<Data::Thread> weakThread) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MarkAsReadThread(not_null<Data::Thread*> thread) {
|
void MarkAsReadThread(not_null<Data::Thread*> thread) {
|
||||||
const auto readHistoryNative = [&](not_null<History*> history)
|
const auto readHistoryNative = [&](const not_null<History*> history)
|
||||||
{
|
{
|
||||||
history->owner().histories().readInbox(history);
|
history->owner().histories().readInbox(history);
|
||||||
};
|
};
|
||||||
const auto sendReadMentions = [=](
|
const auto sendReadMentions = [=](
|
||||||
not_null<Data::Thread*> thread)
|
const not_null<Data::Thread*> threadInner)
|
||||||
{
|
{
|
||||||
readMentions(base::make_weak(thread));
|
readMentions(base::make_weak(threadInner));
|
||||||
};
|
};
|
||||||
const auto sendReadReactions = [=](
|
const auto sendReadReactions = [=](
|
||||||
not_null<Data::Thread*> thread)
|
const not_null<Data::Thread*> threadInner)
|
||||||
{
|
{
|
||||||
readReactions(base::make_weak(thread));
|
readReactions(base::make_weak(threadInner));
|
||||||
};
|
};
|
||||||
|
|
||||||
if (thread->chatListBadgesState().unread) {
|
if (thread->chatListBadgesState().unread) {
|
||||||
|
@ -304,7 +306,7 @@ QString formatTTL(int time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getDCName(int dc) {
|
QString getDCName(int dc) {
|
||||||
const auto getName = [=](int dc)
|
const auto getName = [=]
|
||||||
{
|
{
|
||||||
switch (dc) {
|
switch (dc) {
|
||||||
case 1:
|
case 1:
|
||||||
|
@ -320,7 +322,7 @@ QString getDCName(int dc) {
|
||||||
return {"DC_UNKNOWN"};
|
return {"DC_UNKNOWN"};
|
||||||
}
|
}
|
||||||
|
|
||||||
return QString("DC%1, %2").arg(dc).arg(getName(dc));
|
return QString("DC%1, %2").arg(dc).arg(getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
QString getLocalizedAt() {
|
QString getLocalizedAt() {
|
||||||
|
@ -435,9 +437,7 @@ QString getMediaName(not_null<HistoryItem*> message) {
|
||||||
|
|
||||||
const auto media = message->media();
|
const auto media = message->media();
|
||||||
|
|
||||||
const auto document = media->document();
|
if (const auto document = media->document()) {
|
||||||
|
|
||||||
if (document) {
|
|
||||||
return document->filename();
|
return document->filename();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -801,7 +801,7 @@ TextWithTags extractText(not_null<HistoryItem*> item) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mediaDownloadable(Data::Media *media) {
|
bool mediaDownloadable(const Data::Media *media) {
|
||||||
if (!media
|
if (!media
|
||||||
|| media->webpage() || media->poll() || media->game()
|
|| media->webpage() || media->poll() || media->game()
|
||||||
|| media->invoice() || media->location() || media->paper()
|
|| media->invoice() || media->location() || media->paper()
|
||||||
|
|
|
@ -10,16 +10,14 @@
|
||||||
#include "ayu/data/entities.h"
|
#include "ayu/data/entities.h"
|
||||||
|
|
||||||
#include "core/application.h"
|
#include "core/application.h"
|
||||||
|
#include "data/data_media_types.h"
|
||||||
#include "dialogs/dialogs_main_list.h"
|
#include "dialogs/dialogs_main_list.h"
|
||||||
#include "info/profile/info_profile_badge.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<void(const QString &, UserData *)>;
|
using UsernameResolverCallback = Fn<void(const QString &, UserData *)>;
|
||||||
|
|
||||||
Main::Session *getSession(ID userId);
|
Main::Session *getSession(ID userId);
|
||||||
void dispatchToMainThread(std::function<void()> callback, int delay = 0);
|
void dispatchToMainThread(const std::function<void()> &callback, int delay = 0);
|
||||||
ID getDialogIdFromPeer(not_null<PeerData*> peer);
|
ID getDialogIdFromPeer(not_null<PeerData*> peer);
|
||||||
|
|
||||||
ID getBareID(not_null<PeerData*> peer);
|
ID getBareID(not_null<PeerData*> peer);
|
||||||
|
@ -63,4 +61,4 @@ void searchById(ID userId, Main::Session *session, const UsernameResolverCallbac
|
||||||
ID getUserIdFromPackId(uint64 id);
|
ID getUserIdFromPackId(uint64 id);
|
||||||
|
|
||||||
TextWithTags extractText(not_null<HistoryItem*> item);
|
TextWithTags extractText(not_null<HistoryItem*> item);
|
||||||
bool mediaDownloadable(Data::Media* media);
|
bool mediaDownloadable(const Data::Media* media);
|
|
@ -74,7 +74,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/ayu_state.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"
|
#include "ayu/utils/telegram_helpers.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/utils/telegram_helpers.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/features/forward/ayu_forward.h"
|
||||||
#include "ayu/ui/boxes/message_shot_box.h"
|
#include "ayu/ui/boxes/message_shot_box.h"
|
||||||
#include "boxes/abstract_box.h"
|
#include "boxes/abstract_box.h"
|
||||||
|
|
|
@ -35,7 +35,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#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 "ayu/utils/telegram_helpers.h"
|
||||||
#include "core/ui_integration.h"
|
#include "core/ui_integration.h"
|
||||||
#include "styles/style_ayu_icons.h"
|
#include "styles/style_ayu_icons.h"
|
||||||
|
|
|
@ -89,7 +89,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -57,7 +57,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/ayu_state.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"
|
#include "ayu/utils/telegram_helpers.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#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"
|
#include "styles/style_ayu_icons.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -64,7 +64,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtCore/QMimeData>
|
#include <QtCore/QMimeData>
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -63,7 +63,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QSvgRenderer>
|
#include <QSvgRenderer>
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -23,7 +23,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -46,7 +46,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_chat_helpers.h"
|
#include "styles/style_chat_helpers.h"
|
||||||
|
|
||||||
// AyuGran includes
|
// AyuGran includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
|
|
|
@ -30,7 +30,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/ayu_settings.h"
|
#include "ayu/ayu_settings.h"
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace HistoryView::Reactions {
|
namespace HistoryView::Reactions {
|
||||||
|
|
|
@ -83,7 +83,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_dialogs.h"
|
#include "styles/style_dialogs.h"
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
#include "window/themes/window_theme_preview.h"
|
#include "window/themes/window_theme_preview.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include <QtGui/QClipboard>
|
#include <QtGui/QClipboard>
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
|
|
|
@ -15,7 +15,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/style/style_palette_colorizer.h"
|
#include "ui/style/style_palette_colorizer.h"
|
||||||
|
|
||||||
// AyuGram includes
|
// AyuGram includes
|
||||||
#include "ayu/features/messageshot/message_shot.h"
|
#include "ayu/features/message_shot/message_shot.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Window {
|
namespace Window {
|
||||||
|
|
Loading…
Add table
Reference in a new issue