| 91 | } |
| 92 | |
| 93 | void SharedMedia::remove(SharedMediaRemoveOne &&query) { |
| 94 | auto peerIt = _lists.lower_bound({ query.peerId, MsgId(0) }); |
| 95 | while (peerIt != end(_lists) && peerIt->first.peerId == query.peerId) { |
| 96 | for (auto index = 0; index != kSharedMediaTypeCount; ++index) { |
| 97 | auto type = static_cast<SharedMediaType>(index); |
| 98 | if (query.types.test(type)) { |
| 99 | peerIt->second[index].removeOne(query.messageId); |
| 100 | } |
| 101 | } |
| 102 | ++peerIt; |
| 103 | } |
| 104 | _oneRemoved.fire(std::move(query)); |
| 105 | } |
| 106 | |
| 107 | void SharedMedia::remove(SharedMediaRemoveAll &&query) { |
| 108 | auto peerIt = _lists.lower_bound({ |