| 433 | } |
| 434 | |
| 435 | QImage *PeerData::userpicCloudImage(Ui::PeerUserpicView &view) const { |
| 436 | if (!_userpic.isCurrentView(view.cloud)) { |
| 437 | if (!_userpic.empty()) { |
| 438 | view.cloud = _userpic.createView(); |
| 439 | _userpic.load(&session(), userpicOrigin()); |
| 440 | } else { |
| 441 | view.cloud = nullptr; |
| 442 | } |
| 443 | view.cached = QImage(); |
| 444 | } |
| 445 | if (const auto image = view.cloud.get(); image && !image->isNull()) { |
| 446 | _userpicEmpty = nullptr; |
| 447 | return image; |
| 448 | } else if (isNotificationsUser()) { |
| 449 | static auto result = Window::LogoNoMargin().scaledToWidth( |
| 450 | kUserpicSize, |
| 451 | Qt::SmoothTransformation); |
| 452 | return &result; |
| 453 | } |
| 454 | return nullptr; |
| 455 | } |
| 456 | |
| 457 | void PeerData::paintUserpic( |
| 458 | QPainter &p, |
no test coverage detected