fix: make it build
Some checks are pending
Docker. / Ubuntu (push) Waiting to run

This commit is contained in:
AlexeyZavar 2025-07-07 02:56:10 +03:00
parent 13a96ee1d3
commit e5ca216c99
16 changed files with 46 additions and 25 deletions

View file

@ -141,7 +141,7 @@ static Ui::PreparedList prepareMedia(not_null<Main::Session*> session,
void sendMedia( void sendMedia(
not_null<Main::Session*> session, not_null<Main::Session*> session,
std::shared_ptr<Ui::PreparedBundle> bundle, const std::shared_ptr<Ui::PreparedBundle> &bundle,
not_null<Data::Media*> primaryMedia, not_null<Data::Media*> primaryMedia,
Api::MessageToSend &&message, Api::MessageToSend &&message,
bool sendImagesAsPhotos) { bool sendImagesAsPhotos) {
@ -230,9 +230,9 @@ struct ForwardChunk
void intelligentForward( void intelligentForward(
not_null<Main::Session*> session, not_null<Main::Session*> session,
const Api::SendAction &action, const Api::SendAction &action,
Data::ResolvedForwardDraft draft) { const Data::ResolvedForwardDraft &draft) {
const auto history = action.history; const auto history = action.history;
history->setForwardDraft(action.replyTo.topicRootId, {}); history->setForwardDraft(action.replyTo.topicRootId, action.replyTo.monoforumPeerId, {});
const auto items = draft.items; const auto items = draft.items;
const auto peer = history->peer; const auto peer = history->peer;
@ -296,7 +296,7 @@ void forwardMessages(
const auto history = action.history; const auto history = action.history;
const auto peer = history->peer; const auto peer = history->peer;
history->setForwardDraft(action.replyTo.topicRootId, {}); history->setForwardDraft(action.replyTo.topicRootId, action.replyTo.monoforumPeerId, {});
std::shared_ptr<ForwardState> state; std::shared_ptr<ForwardState> state;

View file

@ -42,7 +42,7 @@ bool isFullAyuForwardNeeded(not_null<HistoryItem*> item);
void intelligentForward( void intelligentForward(
not_null<Main::Session*> session, not_null<Main::Session*> session,
const Api::SendAction &action, const Api::SendAction &action,
Data::ResolvedForwardDraft draft); const Data::ResolvedForwardDraft &draft);
void forwardMessages( void forwardMessages(
not_null<Main::Session*> session, not_null<Main::Session*> session,
const Api::SendAction &action, const Api::SendAction &action,

View file

@ -161,7 +161,7 @@ public:
not_null<Ui::PathShiftGradient*> elementPathShiftGradient() override; not_null<Ui::PathShiftGradient*> elementPathShiftGradient() override;
HistoryView::Context elementContext() override; HistoryView::Context elementContext() override;
bool elementHideReply(not_null<const HistoryView::Element*> view) override; bool elementHideReply(not_null<const HistoryView::Element*> view) override;
bool elementIsChatWide() override; HistoryView::ElementChatMode elementChatMode() override;
private: private:
const not_null<QWidget*> _parent; const not_null<QWidget*> _parent;
@ -207,8 +207,10 @@ bool MessageShotDelegate::elementHideReply(not_null<const HistoryView::Element*>
return false; return false;
} }
bool MessageShotDelegate::elementIsChatWide() { HistoryView::ElementChatMode MessageShotDelegate::elementChatMode() {
return true; using Mode = HistoryView::ElementChatMode;
// Mode::Wide;
return Mode::Default;
} }
QImage removeEmptySpaceAround(const QImage &original) { QImage removeEmptySpaceAround(const QImage &original) {

View file

@ -594,8 +594,9 @@ void InnerWidget::elementSearchInList(
void InnerWidget::elementHandleViaClick(not_null<UserData*> bot) { void InnerWidget::elementHandleViaClick(not_null<UserData*> bot) {
} }
bool InnerWidget::elementIsChatWide() { HistoryView::ElementChatMode InnerWidget::elementChatMode() {
return _isChatWide; using Mode = HistoryView::ElementChatMode;
return _isChatWide ? Mode::Wide : Mode::Default;
} }
not_null<Ui::PathShiftGradient*> InnerWidget::elementPathShiftGradient() { not_null<Ui::PathShiftGradient*> InnerWidget::elementPathShiftGradient() {

View file

@ -120,7 +120,7 @@ public:
const QString &query, const QString &query,
const FullMsgId &context) override; const FullMsgId &context) override;
void elementHandleViaClick(not_null<UserData*> bot) override; void elementHandleViaClick(not_null<UserData*> bot) override;
bool elementIsChatWide() override; HistoryView::ElementChatMode elementChatMode() override;
not_null<Ui::PathShiftGradient*> elementPathShiftGradient() override; not_null<Ui::PathShiftGradient*> elementPathShiftGradient() override;
void elementReplyTo(const FullReplyTo &to) override; void elementReplyTo(const FullReplyTo &to) override;
void elementStartInteraction( void elementStartInteraction(

View file

@ -37,6 +37,7 @@
#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_saved_sublist.h"
namespace { namespace {
@ -170,13 +171,15 @@ void readReactions(base::weak_ptr<Data::Thread> weakThread) {
return; return;
} }
const auto topic = thread->asTopic(); const auto topic = thread->asTopic();
const auto sublist = thread->asSublist();
const auto peer = thread->peer(); const auto peer = thread->peer();
const auto rootId = topic ? topic->rootId() : 0; const auto rootId = topic ? topic->rootId() : 0;
using Flag = MTPmessages_ReadReactions::Flag; using Flag = MTPmessages_ReadReactions::Flag;
peer->session().api().request(MTPmessages_ReadReactions( peer->session().api().request(MTPmessages_ReadReactions(
MTP_flags(rootId ? Flag::f_top_msg_id : Flag(0)), MTP_flags(rootId ? Flag::f_top_msg_id : Flag(0)),
peer->input, peer->input,
MTP_int(rootId) MTP_int(rootId),
sublist ? sublist->sublistPeer()->input : MTPInputPeer()
)).done([=](const MTPmessages_AffectedHistory &result) )).done([=](const MTPmessages_AffectedHistory &result)
{ {
const auto offset = peer->session().api().applyAffectedHistory( const auto offset = peer->session().api().applyAffectedHistory(
@ -185,7 +188,7 @@ void readReactions(base::weak_ptr<Data::Thread> weakThread) {
if (offset > 0) { if (offset > 0) {
readReactions(weakThread); readReactions(weakThread);
} else { } else {
peer->owner().history(peer)->clearUnreadReactionsFor(rootId); peer->owner().history(peer)->clearUnreadReactionsFor(rootId, sublist);
} }
}).send(); }).send();
} }

View file

@ -23,6 +23,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QGuiApplication> #include <QtGui/QGuiApplication>
#include <QtGui/QClipboard> #include <QtGui/QClipboard>
#include "window/window_session_controller.h"
#include "window/window_session_controller_link_info.h"
namespace { namespace {
rpl::producer<TextWithEntities> Text() { rpl::producer<TextWithEntities> Text() {
@ -40,7 +43,7 @@ rpl::producer<TextWithEntities> Text() {
} // namespace } // namespace
void AboutBox(not_null<Ui::GenericBox*> box) { void AboutBox(not_null<Ui::GenericBox*> box, Window::SessionController* controller) {
box->setTitle(rpl::single(u"AyuGram Desktop"_q)); box->setTitle(rpl::single(u"AyuGram Desktop"_q));
auto layout = box->verticalLayout(); auto layout = box->verticalLayout();
@ -75,6 +78,15 @@ void AboutBox(not_null<Ui::GenericBox*> box) {
addText(Text()); addText(Text());
box->addButton(tr::lng_close(), [=] { box->closeBox(); }); box->addButton(tr::lng_close(), [=] { box->closeBox(); });
box->addLeftButton(
rpl::single(QString("@AyuGramReleases")),
[box, controller]
{
box->closeBox();
controller->showPeerByLink(Window::PeerByLinkInfo{
.usernameOrId = QString("ayugramreleases"),
});
});
box->setWidth(st::aboutWidth); box->setWidth(st::aboutWidth);
} }

View file

@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "ui/layers/generic_box.h" #include "ui/layers/generic_box.h"
void AboutBox(not_null<Ui::GenericBox*> box); namespace Window {
class SessionController;
}
void AboutBox(not_null<Ui::GenericBox*> box, Window::SessionController* controller);
QString currentVersionText(); QString currentVersionText();

View file

@ -2251,7 +2251,6 @@ void HistoryWidget::setupDirectMessageButton() {
refreshDirectMessageShown(); refreshDirectMessageShown();
} }
}, _directMessage->lifetime()); }, _directMessage->lifetime());
_giftToChannelDiscuss = setupButton(_discuss);
} }
void HistoryWidget::pushReplyReturn(not_null<HistoryItem*> item) { void HistoryWidget::pushReplyReturn(not_null<HistoryItem*> item) {

View file

@ -431,7 +431,7 @@ void MainWindow::createGlobalMenu() {
u"AyuGram"_q), u"AyuGram"_q),
[=] { [=] {
ensureWindowShown(); ensureWindowShown();
controller().show(Box(AboutBox)); controller().show(Box(AboutBox, sessionController()));
}); });
about->setMenuRole(QAction::AboutQtRole); about->setMenuRole(QAction::AboutQtRole);

View file

@ -369,7 +369,7 @@ void MainWindow::createGlobalMenu() {
{ {
auto callback = [=] { auto callback = [=] {
ensureWindowShown(); ensureWindowShown();
controller().show(Box(AboutBox)); controller().show(Box(AboutBox, sessionController()));
}; };
main->addAction( main->addAction(
tr::lng_mac_menu_about_telegram( tr::lng_mac_menu_about_telegram(

View file

@ -402,7 +402,7 @@ MainMenu::MainMenu(
_version->setLink( _version->setLink(
2, 2,
std::make_shared<LambdaClickHandler>([=] { std::make_shared<LambdaClickHandler>([=] {
controller->show(Box(AboutBox)); controller->show(Box(AboutBox, controller));
})); }));
rpl::combine( rpl::combine(

@ -1 +1 @@
Subproject commit 9523ff72aea22f760c9b99e98b489ced316e0cb8 Subproject commit e459dbafe77c034b6c48b4fae94ff86e4097bffb

View file

@ -1,8 +1,8 @@
[Desktop Entry] [Desktop Entry]
Name=AyuGram Desktop Name=AyuGram Desktop
Comment=Desktop version of AyuGram - ToS breaking Telegram client Comment=Desktop version of AyuGram - ToS breaking Telegram client
TryExec=ayugram-desktop TryExec=AyuGram
Exec=env DESKTOPINTEGRATION=1 ayugram-desktop -- %u Exec=env DESKTOPINTEGRATION=1 AyuGram -- %u
Icon=com.ayugram.desktop Icon=com.ayugram.desktop
Terminal=false Terminal=false
StartupWMClass=AyuGram StartupWMClass=AyuGram
@ -17,6 +17,6 @@ X-GNOME-UsesNotifications=true
X-GNOME-SingleWindow=true X-GNOME-SingleWindow=true
[Desktop Action quit] [Desktop Action quit]
Exec=ayugram-desktop -quit Exec=AyuGram -quit
Name=Quit AyuGram Name=Quit AyuGram
Icon=application-exit Icon=application-exit

View file

@ -75,6 +75,6 @@
</content_rating> </content_rating>
<launchable type="desktop-id">com.ayugram.desktop.desktop</launchable> <launchable type="desktop-id">com.ayugram.desktop.desktop</launchable>
<provides> <provides>
<binary>ayugram-desktop</binary> <binary>AyuGram</binary>
</provides> </provides>
</component> </component>

View file

@ -1,3 +1,3 @@
[D-BUS Service] [D-BUS Service]
Name=com.ayugram.desktop Name=com.ayugram.desktop
Exec=@CMAKE_INSTALL_FULL_BINDIR@/ayugram-desktop Exec=@CMAKE_INSTALL_FULL_BINDIR@/AyuGram