// This is the source code of AyuGram for Desktop. // // We do not and cannot prevent the use of our code, // but be respectful and credit the original author. // // Copyright @Radolyn, 2023 #include "ayu_state.h" namespace AyuState { std::unordered_map> hiddenMessages; void hide(PeerId peerId, MsgId messageId) { hiddenMessages[peerId].insert(messageId); } void hide(not_null item) { hide(item->history()->peer->id, item->id); } bool isHidden(PeerId peerId, MsgId messageId) { auto it = hiddenMessages.find(peerId); if (it != hiddenMessages.end()) { return it->second.find(messageId) != it->second.end(); } return false; } bool isHidden(not_null item) { return isHidden(item->history()->peer->id, item->id); } }