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

Method registerMessage

Telegram/SourceFiles/data/data_session.cpp:2871–2885  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2869}
2870
2871void Session::registerMessage(not_null<HistoryItem*> item) {
2872 const auto peerId = item->history()->peer->id;
2873 const auto list = messagesListForInsert(peerId);
2874 const auto itemId = item->id;
2875 const auto i = list->find(itemId);
2876 if (i != list->end()) {
2877 LOG(("App Error: Trying to re-registerMessage()."));
2878 i->second->destroy();
2879 }
2880 list->emplace(itemId, item);
2881
2882 if (!peerIsChannel(peerId) && IsServerMsgId(itemId)) {
2883 _nonChannelMessages.emplace(itemId, item);
2884 }
2885}
2886
2887void Session::registerMessageTTL(TimeId when, not_null<HistoryItem*> item) {
2888 Expects(when > 0);

Callers

nothing calls this directly

Calls 7

peerIsChannelFunction · 0.85
IsServerMsgIdFunction · 0.85
emplaceMethod · 0.80
historyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected