| 4467 | } |
| 4468 | |
| 4469 | void InnerWidget::updateSearchIn() { |
| 4470 | if (!_searchState.inChat |
| 4471 | && _searchHashOrCashtag == HashOrCashtag::None) { |
| 4472 | _searchIn = nullptr; |
| 4473 | return; |
| 4474 | } else if (!_searchIn) { |
| 4475 | _searchIn = std::make_unique<ChatSearchIn>(this); |
| 4476 | _searchIn->show(); |
| 4477 | _searchIn->changeFromRequests() | rpl::start_to_stream( |
| 4478 | _changeSearchFromRequests, |
| 4479 | _searchIn->lifetime()); |
| 4480 | _searchIn->cancelFromRequests() | rpl::start_to_stream( |
| 4481 | _cancelSearchFromRequests, |
| 4482 | _searchIn->lifetime()); |
| 4483 | _searchIn->cancelInRequests() | rpl::start_to_stream( |
| 4484 | _cancelSearchRequests, |
| 4485 | _searchIn->lifetime()); |
| 4486 | _searchIn->tabChanges() | rpl::start_to_stream( |
| 4487 | _changeSearchTabRequests, |
| 4488 | _searchIn->lifetime()); |
| 4489 | } |
| 4490 | |
| 4491 | const auto sublist = _searchState.inChat.sublist(); |
| 4492 | const auto topic = _searchState.inChat.topic(); |
| 4493 | const auto peer = _searchState.inChat.owningHistory() |
| 4494 | ? _searchState.inChat.owningHistory()->peer.get() |
| 4495 | : _openedForum |
| 4496 | ? _openedForum->peer().get() |
| 4497 | : nullptr; |
| 4498 | const auto paused = [window = _controller] { |
| 4499 | return window->isGifPausedAtLeastFor(Window::GifPauseReason::Any); |
| 4500 | }; |
| 4501 | const auto textFg = [] { |
| 4502 | return st::windowSubTextFg->c; |
| 4503 | }; |
| 4504 | const auto topicIcon = !topic |
| 4505 | ? nullptr |
| 4506 | : topic->iconId() |
| 4507 | ? Ui::MakeEmojiThumbnail( |
| 4508 | &topic->owner(), |
| 4509 | Data::SerializeCustomEmojiId(topic->iconId()), |
| 4510 | paused, |
| 4511 | textFg) |
| 4512 | : Ui::MakeEmojiThumbnail( |
| 4513 | &topic->owner(), |
| 4514 | Data::TopicIconEmojiEntity({ |
| 4515 | .title = (topic->isGeneral() |
| 4516 | ? Data::ForumGeneralIconTitle() |
| 4517 | : topic->title()), |
| 4518 | .colorId = (topic->isGeneral() |
| 4519 | ? Data::ForumGeneralIconColor(st::windowSubTextFg->c) |
| 4520 | : topic->colorId()), |
| 4521 | }), |
| 4522 | paused, |
| 4523 | textFg); |
| 4524 | const auto peerIcon = peer |
| 4525 | ? Ui::MakeUserpicThumbnail(peer) |
| 4526 | : sublist |
nothing calls this directly
no test coverage detected