fix: read after forward

This commit is contained in:
AlexeyZavar 2024-03-13 13:48:56 +03:00
parent a73da65253
commit 6d08b5bf23
2 changed files with 20 additions and 0 deletions

View file

@ -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) {

View file

@ -57,6 +57,11 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include <QtGui/QGuiApplication>
#include <QtGui/QClipboard>
// 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) {