diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index 58dd1c4ca..d7791f285 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -87,6 +87,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL // AyuGram includes #include "ayu/ayu_settings.h" #include "ayu/ayu_worker.h" +#include "ayu/utils/telegram_helpers.h" namespace { @@ -3322,6 +3323,13 @@ void ApiWrap::forwardMessages( if (shared && !--shared->requestsLeft) { shared->callback(); } + + const auto settings = &AyuSettings::getInstance(); + if (!settings->sendReadMessages && settings->markReadAfterPoll && history->lastMessage()) + { + readHistory(history->lastMessage()); + } + finish(); }).fail([=](const MTP::Error &error) { if (idsCopy) { diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 4581fac40..80ade57fe 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -57,6 +57,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include #include +// AyuGram includes +#include "ayu/ayu_settings.h" +#include "ayu/utils/telegram_helpers.h" + + class ShareBox::Inner final : public Ui::RpWidget { public: Inner( @@ -1577,6 +1582,13 @@ ShareBox::SubmitCallback ShareBox::DefaultForwardCallback( show->hideLayer(); } } + + const auto settings = &AyuSettings::getInstance(); + if (!settings->sendReadMessages && settings->markReadAfterPoll && history->lastMessage()) + { + readHistory(history->lastMessage()); + } + finish(); }).fail([=](const MTP::Error &error) { if (error.type() == u"VOICE_MESSAGES_FORBIDDEN"_q) {