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

Method setInboxReadTill

Telegram/SourceFiles/data/data_replies_list.cpp:787–809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

785}
786
787void RepliesList::setInboxReadTill(
788 MsgId readTillId,
789 std::optional<int> unreadCount) {
790 const auto newReadTillId = std::max(readTillId.bare, int64(1));
791 const auto ignore = (newReadTillId < _inboxReadTillId);
792 if (ignore) {
793 return;
794 }
795 const auto changed = (newReadTillId > _inboxReadTillId);
796 if (changed) {
797 _inboxReadTillId = newReadTillId;
798 }
799 if (_skippedAfter == 0
800 && !_list.empty()
801 && _inboxReadTillId >= _list.front()) {
802 unreadCount = 0;
803 }
804 const auto wasUnreadCount = _unreadCount;
805 if (_unreadCount.current() != unreadCount
806 && (changed || unreadCount.has_value())) {
807 setUnreadCount(unreadCount);
808 }
809}
810
811MsgId RepliesList::inboxReadTillId() const {
812 return _inboxReadTillId;

Callers 8

applyTopicMethod · 0.45
updateUnreadCountsMethod · 0.45
requestUnreadCountMethod · 0.45
updateUnreadCountsMethod · 0.45
readInboxTillMethod · 0.45
dialogEntryAppliedMethod · 0.45

Calls 4

frontMethod · 0.80
has_valueMethod · 0.80
emptyMethod · 0.45
currentMethod · 0.45

Tested by

no test coverage detected