| 209 | } |
| 210 | |
| 211 | void JoinRichMessageChannel( |
| 212 | not_null<Main::Session*> session, |
| 213 | const QString &context) { |
| 214 | const auto parsed = ParseNativeIvChannelContext(context); |
| 215 | if (const auto channelId = ChannelId(parsed.channelId)) { |
| 216 | const auto channel = session->data().channel(channelId); |
| 217 | if (channel->isLoaded()) { |
| 218 | session->api().joinChannel(channel); |
| 219 | } else if (const auto username = ResolveNativeIvChannelUsername( |
| 220 | channel->username(), |
| 221 | parsed.username); !username.isEmpty()) { |
| 222 | if (const auto controller = session->tryResolveWindow(channel)) { |
| 223 | controller->showPeerByLink({ |
| 224 | .usernameOrId = username, |
| 225 | .joinChannel = true, |
| 226 | }); |
| 227 | } |
| 228 | } |
| 229 | } |
| 230 | } |
| 231 | |
| 232 | [[nodiscard]] bool ActivateRichMessageMedia( |
| 233 | const Markdown::MediaActivation &activation, |
no test coverage detected