| 3446 | } |
| 3447 | |
| 3448 | void ApiWrap::sharedMediaDone( |
| 3449 | not_null<PeerData*> peer, |
| 3450 | MsgId topicRootId, |
| 3451 | PeerId monoforumPeerId, |
| 3452 | SharedMediaType type, |
| 3453 | Api::SearchResult &&parsed) { |
| 3454 | const auto topic = peer->forumTopicFor(topicRootId); |
| 3455 | const auto sublist = peer->monoforumSublistFor(monoforumPeerId); |
| 3456 | if ((topicRootId && !topic) || (monoforumPeerId && !sublist)) { |
| 3457 | return; |
| 3458 | } |
| 3459 | const auto hasMessages = !parsed.messageIds.empty(); |
| 3460 | _session->storage().add(Storage::SharedMediaAddSlice( |
| 3461 | peer->id, |
| 3462 | topicRootId, |
| 3463 | monoforumPeerId, |
| 3464 | type, |
| 3465 | std::move(parsed.messageIds), |
| 3466 | parsed.noSkipRange, |
| 3467 | parsed.fullCount |
| 3468 | )); |
| 3469 | if (type == SharedMediaType::Pinned && hasMessages) { |
| 3470 | peer->owner().history(peer)->setHasPinnedMessages(true); |
| 3471 | if (topic) { |
| 3472 | topic->setHasPinnedMessages(true); |
| 3473 | } |
| 3474 | if (sublist) { |
| 3475 | sublist->setHasPinnedMessages(true); |
| 3476 | } |
| 3477 | } |
| 3478 | } |
| 3479 | |
| 3480 | mtpRequestId ApiWrap::requestGlobalMedia( |
| 3481 | Storage::SharedMediaType type, |
nothing calls this directly
no test coverage detected