| 187 | } |
| 188 | |
| 189 | void OpenRichMessageChannel( |
| 190 | not_null<Main::Session*> session, |
| 191 | const QString &context) { |
| 192 | const auto parsed = ParseNativeIvChannelContext(context); |
| 193 | if (const auto channelId = ChannelId(parsed.channelId)) { |
| 194 | const auto channel = session->data().channel(channelId); |
| 195 | if (channel->isLoaded()) { |
| 196 | if (const auto controller = session->tryResolveWindow(channel)) { |
| 197 | controller->showPeerHistory(channel); |
| 198 | } |
| 199 | } else if (const auto username = ResolveNativeIvChannelUsername( |
| 200 | channel->username(), |
| 201 | parsed.username); !username.isEmpty()) { |
| 202 | if (const auto controller = session->tryResolveWindow(channel)) { |
| 203 | controller->showPeerByLink({ |
| 204 | .usernameOrId = username, |
| 205 | }); |
| 206 | } |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | void JoinRichMessageChannel( |
| 212 | not_null<Main::Session*> session, |
no test coverage detected