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

Method processMessagesDeleted

Telegram/SourceFiles/data/data_session.cpp:2991–3023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2989}
2990
2991void Session::processMessagesDeleted(
2992 PeerId peerId,
2993 const QVector<MTPint> &data) {
2994 const auto list = messagesList(peerId);
2995 const auto affected = historyLoaded(peerId);
2996 if (!list && !affected) {
2997 return;
2998 }
2999
3000 auto toDestroy = std::vector<not_null<HistoryItem*>>();
3001 auto historiesToCheck = base::flat_set<not_null<History*>>();
3002 for (const auto &messageId : data) {
3003 const auto i = list ? list->find(messageId.v) : Messages::iterator();
3004 if (list && i != list->end()) {
3005 const auto history = i->second->history();
3006 toDestroy.push_back(i->second);
3007 historiesToCheck.emplace(history);
3008 } else if (affected) {
3009 affected->unknownMessageDeleted(messageId.v);
3010 }
3011 }
3012 if (!toDestroy.empty()) {
3013 notifyItemsAboutToBeDestroyed(toDestroy);
3014 for (const auto &item : toDestroy) {
3015 item->destroy();
3016 }
3017 }
3018 for (const auto &history : historiesToCheck) {
3019 if (!history->chatListMessageKnown()) {
3020 history->requestChatListMessage();
3021 }
3022 }
3023}
3024
3025void Session::processNonChannelMessagesDeleted(const QVector<MTPint> &data) {
3026 auto toDestroy = std::vector<not_null<HistoryItem*>>();

Callers 1

applyUpdateNoPtsCheckMethod · 0.80

Calls 9

emplaceMethod · 0.80
unknownMessageDeletedMethod · 0.80
findMethod · 0.45
endMethod · 0.45
historyMethod · 0.45
emptyMethod · 0.45
destroyMethod · 0.45
chatListMessageKnownMethod · 0.45

Tested by

no test coverage detected