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

Method parse

Telegram/SourceFiles/api/api_invite_links.cpp:743–770  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743auto InviteLinks::parse(
744 not_null<PeerData*> peer,
745 const MTPExportedChatInvite &invite) const -> std::optional<Link> {
746 return invite.match([&](const MTPDchatInviteExported &data) {
747 return std::optional<Link>(Link{
748 .link = qs(data.vlink()),
749 .label = qs(data.vtitle().value_or_empty()),
750 .subscription = data.vsubscription_pricing()
751 ? Data::PeerSubscription{
752 data.vsubscription_pricing()->data().vamount().v,
753 data.vsubscription_pricing()->data().vperiod().v,
754 }
755 : Data::PeerSubscription(),
756 .admin = peer->session().data().user(data.vadmin_id()),
757 .date = data.vdate().v,
758 .startDate = data.vstart_date().value_or_empty(),
759 .expireDate = data.vexpire_date().value_or_empty(),
760 .usageLimit = data.vusage_limit().value_or_empty(),
761 .usage = data.vusage().value_or_empty(),
762 .requested = data.vrequested().value_or_empty(),
763 .requestApproval = data.is_request_needed(),
764 .permanent = data.is_permanent(),
765 .revoked = data.is_revoked(),
766 });
767 }, [&](const MTPDchatInvitePublicJoinRequests &data) {
768 return std::optional<Link>();
769 });
770}
771
772void InviteLinks::requestMoreLinks(
773 not_null<PeerData*> peer,

Callers

nothing calls this directly

Calls 5

qsFunction · 0.85
PeerSubscriptionClass · 0.85
dataMethod · 0.45
userMethod · 0.45
sessionMethod · 0.45

Tested by

no test coverage detected