| 396 | } |
| 397 | |
| 398 | void WebPageData::ApplyChanges( |
| 399 | not_null<Main::Session*> session, |
| 400 | ChannelData *channel, |
| 401 | const MTPmessages_Messages &result) { |
| 402 | const auto list = result.match([]( |
| 403 | const MTPDmessages_messagesNotModified &) { |
| 404 | LOG(("API Error: received messages.messagesNotModified! " |
| 405 | "(WebPageData::ApplyChanges)")); |
| 406 | return static_cast<const QVector<MTPMessage>*>(nullptr); |
| 407 | }, [&](const auto &data) { |
| 408 | session->data().processUsers(data.vusers()); |
| 409 | session->data().processChats(data.vchats()); |
| 410 | return &data.vmessages().v; |
| 411 | }); |
| 412 | result.match([&]( |
| 413 | const MTPDmessages_channelMessages &data) { |
| 414 | if (channel) { |
| 415 | channel->ptsReceived(data.vpts().v); |
| 416 | channel->processTopics(data.vtopics()); |
| 417 | } else { |
| 418 | LOG(("API Error: received messages.channelMessages " |
| 419 | "when no channel was passed! (WebPageData::ApplyChanges)")); |
| 420 | } |
| 421 | }, [&](const auto &) { |
| 422 | }); |
| 423 | result.match([]( |
| 424 | const MTPDmessages_messagesNotModified &) { |
| 425 | }, [&](const auto &data) { |
| 426 | if (channel) { |
| 427 | channel->processTopics(data.vtopics()); |
| 428 | } |
| 429 | }); |
| 430 | if (!list) { |
| 431 | return; |
| 432 | } |
| 433 | |
| 434 | for (const auto &message : *list) { |
| 435 | message.match([&](const MTPDmessage &data) { |
| 436 | if (const auto media = data.vmedia()) { |
| 437 | media->match([&](const MTPDmessageMediaWebPage &data) { |
| 438 | session->data().processWebpage(data.vwebpage()); |
| 439 | }, [&](const auto &) { |
| 440 | }); |
| 441 | } |
| 442 | }, [&](const auto &) { |
| 443 | }); |
| 444 | } |
| 445 | session->data().sendWebPageGamePollTodoListNotifications(); |
| 446 | } |
| 447 | |
| 448 | QString WebPageData::displayedSiteName() const { |
| 449 | return (document && document->isWallPaper()) |
nothing calls this directly
no test coverage detected