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

Method applyTopic

Telegram/SourceFiles/data/data_forum_topic.cpp:393–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393void ForumTopic::applyTopic(const MTPDforumTopic &data) {
394 Expects(_rootId == data.vid().v);
395
396 const auto min = data.is_short();
397
398 applyCreator(peerFromMTP(data.vfrom_id()));
399 applyCreationDate(data.vdate().v);
400
401 applyTitle(qs(data.vtitle()));
402 if (const auto iconId = data.vicon_emoji_id()) {
403 applyIconId(iconId->v);
404 } else {
405 applyIconId(0);
406 }
407 applyColorId(data.vicon_color().v);
408
409 applyIsMy(data.is_my());
410 setClosed(data.is_closed());
411
412 if (!min) {
413 owner().setPinnedFromEntryList(this, data.is_pinned());
414 owner().notifySettings().apply(this, data.vnotify_settings());
415
416 if (const auto draft = data.vdraft()) {
417 draft->match([&](const MTPDdraftMessage &data) {
418 Data::ApplyPeerCloudDraft(
419 &session(),
420 peer()->id,
421 _rootId,
422 PeerId(),
423 data);
424 }, [](const MTPDdraftMessageEmpty&) {});
425 }
426
427 _replies->setInboxReadTill(
428 data.vread_inbox_max_id().v,
429 data.vunread_count().v);
430 _replies->setOutboxReadTill(data.vread_outbox_max_id().v);
431 applyTopicTopMessage(data.vtop_message().v);
432 unreadMentions().setCount(data.vunread_mentions_count().v);
433 unreadReactions().setCount(data.vunread_reactions_count().v);
434 unreadPollVotes().setCount(data.vunread_poll_votes_count().v);
435 }
436}
437
438void ForumTopic::applyCreator(PeerId creatorId) {
439 if (_creatorId != creatorId) {

Callers 1

applyReceivedTopicsMethod · 0.80

Calls 9

peerFromMTPFunction · 0.85
qsFunction · 0.85
ApplyPeerCloudDraftFunction · 0.85
PeerIdClass · 0.85
applyMethod · 0.45
setInboxReadTillMethod · 0.45
setOutboxReadTillMethod · 0.45
setCountMethod · 0.45

Tested by

no test coverage detected