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

Function Parse

Telegram/SourceFiles/data/data_peer.cpp:186–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186AllowedReactions Parse(
187 const MTPChatReactions &value,
188 int maxCount,
189 bool paidEnabled) {
190 return value.match([&](const MTPDchatReactionsNone &) {
191 return AllowedReactions{
192 .maxCount = maxCount,
193 .paidEnabled = paidEnabled,
194 };
195 }, [&](const MTPDchatReactionsAll &data) {
196 return AllowedReactions{
197 .maxCount = maxCount,
198 .type = (data.is_allow_custom()
199 ? AllowedReactionsType::All
200 : AllowedReactionsType::Default),
201 .paidEnabled = paidEnabled,
202 };
203 }, [&](const MTPDchatReactionsSome &data) {
204 return AllowedReactions{
205 .some = ranges::views::all(
206 data.vreactions().v
207 ) | ranges::views::transform(
208 ReactionFromMTP
209 ) | ranges::to_vector,
210 .maxCount = maxCount,
211 .type = AllowedReactionsType::Some,
212 .paidEnabled = paidEnabled,
213 };
214 });
215}
216
217PeerData *PeerFromInputMTP(
218 not_null<Session*> owner,

Callers 15

ApplyChannelUpdateFunction · 0.70
ParseMethod · 0.70
applyUpdateMethod · 0.70
showPreviewMethod · 0.70
parseThemesMethod · 0.70
parseChatThemesMethod · 0.70
ApplyChatUpdateFunction · 0.70
loadMoreRowsMethod · 0.50
loadMoreRowsMethod · 0.50
loadMoreRowsMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected