| 184 | } |
| 185 | |
| 186 | AllowedReactions 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 | |
| 217 | PeerData *PeerFromInputMTP( |
| 218 | not_null<Session*> owner, |
no outgoing calls
no test coverage detected