mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Mark topics as read on reply from notification.
This commit is contained in:
parent
ef3ed760b1
commit
06d1644baa
4 changed files with 14 additions and 3 deletions
|
@ -2999,7 +2999,14 @@ void ApiWrap::sharedMediaDone(
|
|||
|
||||
void ApiWrap::sendAction(const SendAction &action) {
|
||||
if (!action.options.scheduled) {
|
||||
_session->data().histories().readInbox(action.history);
|
||||
const auto topic = action.topicRootId
|
||||
? action.history->peer->forumTopicFor(action.topicRootId)
|
||||
: nullptr;
|
||||
if (topic) {
|
||||
topic->readTillEnd();
|
||||
} else {
|
||||
_session->data().histories().readInbox(action.history);
|
||||
}
|
||||
action.history->getReadyFor(ShowAtTheEndMsgId);
|
||||
}
|
||||
_sendActions.fire_copy(action);
|
||||
|
|
|
@ -254,6 +254,10 @@ void ForumTopic::setRealRootId(MsgId realId) {
|
|||
}
|
||||
}
|
||||
|
||||
void ForumTopic::readTillEnd() {
|
||||
_replies->readTill(_lastKnownServerMessageId);
|
||||
}
|
||||
|
||||
void ForumTopic::applyTopic(const MTPDforumTopic &data) {
|
||||
Expects(_rootId == data.vid().v);
|
||||
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
void discard();
|
||||
|
||||
void setRealRootId(MsgId realId);
|
||||
void readTillEnd();
|
||||
|
||||
void applyTopic(const MTPDforumTopic &data);
|
||||
|
||||
|
|
|
@ -65,7 +65,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||
#include "data/data_drafts.h"
|
||||
#include "data/data_forum.h"
|
||||
#include "data/data_forum_topic.h"
|
||||
#include "data/data_replies_list.h"
|
||||
#include "data/data_user.h"
|
||||
#include "data/data_scheduled_messages.h"
|
||||
#include "data/data_histories.h"
|
||||
|
@ -134,7 +133,7 @@ void MarkAsReadThread(not_null<Data::Thread*> thread) {
|
|||
}
|
||||
}
|
||||
} else if (const auto topic = thread->asTopic()) {
|
||||
topic->replies()->readTill(topic->lastKnownServerMessageId());
|
||||
topic->readTillEnd();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue