| 1345 | } |
| 1346 | |
| 1347 | void Instance::showRichMessage( |
| 1348 | not_null<Window::SessionController*> controller, |
| 1349 | not_null<HistoryItem*> item, |
| 1350 | QString initialFragment) { |
| 1351 | const auto weak = base::make_weak(controller); |
| 1352 | const auto itemId = item->fullId(); |
| 1353 | resolveRichMessage(controller, item, [=](std::shared_ptr<const RichPage> page) { |
| 1354 | const auto strong = weak.get(); |
| 1355 | const auto current = strong |
| 1356 | ? strong->session().data().message(itemId) |
| 1357 | : nullptr; |
| 1358 | if (!page || !current) { |
| 1359 | if (strong && !page) { |
| 1360 | Ui::Toast::Show(tr::lng_iv_not_supported(tr::now)); |
| 1361 | } |
| 1362 | return; |
| 1363 | } |
| 1364 | showRichMessage( |
| 1365 | not_null{ strong }, |
| 1366 | not_null{ current }, |
| 1367 | std::move(page), |
| 1368 | initialFragment); |
| 1369 | }); |
| 1370 | } |
| 1371 | |
| 1372 | void Instance::showRichMessage( |
| 1373 | not_null<Window::SessionController*> controller, |
no test coverage detected