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

Method sharedMediaDone

Telegram/SourceFiles/apiwrap.cpp:3448–3478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3446}
3447
3448void 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
3480mtpRequestId ApiWrap::requestGlobalMedia(
3481 Storage::SharedMediaType type,

Callers

nothing calls this directly

Calls 8

forumTopicForMethod · 0.80
monoforumSublistForMethod · 0.80
setHasPinnedMessagesMethod · 0.80
SharedMediaAddSliceClass · 0.50
emptyMethod · 0.45
addMethod · 0.45
historyMethod · 0.45
ownerMethod · 0.45

Tested by

no test coverage detected