mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-10-11 13:47:24 +00:00
Save last opened subsection within a launch.
This commit is contained in:
@@ -189,6 +189,9 @@ void Forum::applyTopicDeleted(MsgId rootId) {
|
||||
reorderLastTopics();
|
||||
}
|
||||
|
||||
if (_activeSubsectionTopic == raw) {
|
||||
_activeSubsectionTopic = nullptr;
|
||||
}
|
||||
_topicDestroyed.fire(raw);
|
||||
session().changes().topicUpdated(
|
||||
raw,
|
||||
@@ -259,6 +262,20 @@ const std::vector<not_null<ForumTopic*>> &Forum::recentTopics() const {
|
||||
return _lastTopics;
|
||||
}
|
||||
|
||||
void Forum::saveActiveSubsectionThread(not_null<Thread*> thread) {
|
||||
if (const auto topic = thread->asTopic()) {
|
||||
Assert(topic->forum() == this);
|
||||
_activeSubsectionTopic = topic->creating() ? nullptr : topic;
|
||||
} else {
|
||||
Assert(thread == history());
|
||||
_activeSubsectionTopic = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Thread *Forum::activeSubsectionThread() const {
|
||||
return _activeSubsectionTopic;
|
||||
}
|
||||
|
||||
void Forum::listMessageChanged(HistoryItem *from, HistoryItem *to) {
|
||||
if (from || to) {
|
||||
reorderLastTopics();
|
||||
|
Reference in New Issue
Block a user