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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -23,6 +23,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
#include "window/window_session_controller.h"
#include "window/window_session_controller_link_info.h"
namespace {
rpl::producer<TextWithEntities> Text() {
@ -40,7 +43,7 @@ rpl::producer<TextWithEntities> Text() {
} // 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));
auto layout = box->verticalLayout();
@ -75,6 +78,15 @@ void AboutBox(not_null<Ui::GenericBox*> box) {
addText(Text());
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);
}

View file

@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#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();

View file

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

View file

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

View file

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

View file

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

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

View file

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

View file

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

View file

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