MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / MarkAsReadThread

Function MarkAsReadThread

Telegram/SourceFiles/window/window_peer_menu.cpp:4315–4335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4313}
4314
4315void MarkAsReadThread(not_null<Data::Thread*> thread) {
4316 const auto readHistory = [&](not_null<History*> history) {
4317 history->owner().histories().readInbox(history);
4318 };
4319 if (!IsUnreadThread(thread)) {
4320 return;
4321 } else if (const auto forum = thread->asForum()) {
4322 forum->enumerateTopics([](not_null<Data::ForumTopic*> topic) {
4323 MarkAsReadThread(topic);
4324 });
4325 } else if (const auto history = thread->asHistory()) {
4326 readHistory(history);
4327 if (const auto migrated = history->migrateSibling()) {
4328 readHistory(migrated);
4329 }
4330 } else if (const auto topic = thread->asTopic()) {
4331 topic->readTillEnd();
4332 } else if (const auto sublist = thread->asSublist()) {
4333 sublist->readTillEnd();
4334 }
4335}
4336
4337void AddSeparatorAndShiftUp(const PeerMenuCallback &addAction) {
4338 addAction({

Callers 4

showMethod · 0.85
addToggleUnreadMarkMethod · 0.85
PerformQuickDialogActionFunction · 0.85
setupShortcutsMethod · 0.85

Calls 10

IsUnreadThreadFunction · 0.85
readInboxMethod · 0.80
asForumMethod · 0.80
enumerateTopicsMethod · 0.80
asHistoryMethod · 0.80
migrateSiblingMethod · 0.80
asTopicMethod · 0.80
asSublistMethod · 0.80
ownerMethod · 0.45
readTillEndMethod · 0.45

Tested by

no test coverage detected