mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
fix: crash when viewing story with ghost mode
This commit is contained in:
parent
e9d9e8df49
commit
7fe6ca1f41
1 changed files with 26 additions and 1 deletions
|
@ -1058,6 +1058,21 @@ void Stories::markAsRead(FullStoryId id, bool viewed) {
|
||||||
if (!maybeStory) {
|
if (!maybeStory) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// AyuGram sendReadStories
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
if (!settings->sendReadStories)
|
||||||
|
{
|
||||||
|
_markReadRequests.clear();
|
||||||
|
_markReadPending.clear();
|
||||||
|
|
||||||
|
_incrementViewsRequests.clear();
|
||||||
|
_incrementViewsPending.clear();
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const auto story = *maybeStory;
|
const auto story = *maybeStory;
|
||||||
if (story->expired() && story->pinned()) {
|
if (story->expired() && story->pinned()) {
|
||||||
_incrementViewsPending[id.peer].emplace(id.story);
|
_incrementViewsPending[id.peer].emplace(id.story);
|
||||||
|
@ -1207,6 +1222,10 @@ void Stories::sendMarkAsReadRequest(
|
||||||
{
|
{
|
||||||
_markReadRequests.clear();
|
_markReadRequests.clear();
|
||||||
_markReadPending.clear();
|
_markReadPending.clear();
|
||||||
|
|
||||||
|
_incrementViewsRequests.clear();
|
||||||
|
_incrementViewsPending.clear();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1588,7 +1607,13 @@ void Stories::report(
|
||||||
|
|
||||||
bool Stories::isQuitPrevent() {
|
bool Stories::isQuitPrevent() {
|
||||||
if (!_markReadPending.empty()) {
|
if (!_markReadPending.empty()) {
|
||||||
sendMarkAsReadRequests();
|
// AyuGram sendReadStories
|
||||||
|
const auto settings = &AyuSettings::getInstance();
|
||||||
|
|
||||||
|
if (settings->sendReadStories)
|
||||||
|
{
|
||||||
|
sendMarkAsReadRequests();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!_incrementViewsPending.empty()) {
|
if (!_incrementViewsPending.empty()) {
|
||||||
sendIncrementViewsRequests();
|
sendIncrementViewsRequests();
|
||||||
|
|
Loading…
Add table
Reference in a new issue