| 1217 | } |
| 1218 | |
| 1219 | void Histories::cancelRequest(int id) { |
| 1220 | if (!id) { |
| 1221 | return; |
| 1222 | } else if (_creatingTopicRequests.contains(id)) { |
| 1223 | cancelDelayedByTopicRequest(id); |
| 1224 | return; |
| 1225 | } |
| 1226 | const auto history = _historyByRequest.take(id); |
| 1227 | if (!history) { |
| 1228 | return; |
| 1229 | } |
| 1230 | const auto state = lookup(*history); |
| 1231 | if (!state) { |
| 1232 | return; |
| 1233 | } |
| 1234 | state->postponed.remove(id); |
| 1235 | finishSentRequest(*history, state, id); |
| 1236 | } |
| 1237 | |
| 1238 | void Histories::cancelDelayedByTopicRequest(int id) { |
| 1239 | for (auto &[rootId, messages] : _creatingTopics) { |
no test coverage detected