mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Mark topics as read on reply from notification.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user