| 3968 | } |
| 3969 | |
| 3970 | not_null<WebPageData*> Session::processWebpage(const MTPWebPage &data) { |
| 3971 | switch (data.type()) { |
| 3972 | case mtpc_webPage: |
| 3973 | return processWebpage(data.c_webPage()); |
| 3974 | case mtpc_webPageEmpty: { |
| 3975 | const auto result = webpage(data.c_webPageEmpty().vid().v); |
| 3976 | result->type = WebPageType::None; |
| 3977 | if (result->pendingTill > 0) { |
| 3978 | result->pendingTill = 0; |
| 3979 | result->failed = 1; |
| 3980 | notifyWebPageUpdateDelayed(result); |
| 3981 | } |
| 3982 | return result; |
| 3983 | } break; |
| 3984 | case mtpc_webPagePending: |
| 3985 | return processWebpage(data.c_webPagePending()); |
| 3986 | case mtpc_webPageNotModified: |
| 3987 | LOG(("API Error: " |
| 3988 | "webPageNotModified is unexpected in Session::webpage().")); |
| 3989 | return webpage(0); |
| 3990 | } |
| 3991 | Unexpected("Type in Session::webpage()."); |
| 3992 | } |
| 3993 | |
| 3994 | not_null<WebPageData*> Session::processWebpage(const MTPDwebPage &data) { |
| 3995 | const auto result = webpage(data.vid().v); |
no test coverage detected