| 2869 | } |
| 2870 | |
| 2871 | void 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 | |
| 2887 | void Session::registerMessageTTL(TimeId when, not_null<HistoryItem*> item) { |
| 2888 | Expects(when > 0); |
nothing calls this directly
no test coverage detected