Fix group call bar in legacy groups.

This commit is contained in:
John Preston 2020-12-18 19:21:57 +04:00
parent 2fb220985a
commit 7a07acb124

View file

@ -5407,14 +5407,14 @@ void HistoryWidget::refreshPinnedBarButton(bool many) {
void HistoryWidget::setupGroupCallTracker() { void HistoryWidget::setupGroupCallTracker() {
Expects(_history != nullptr); Expects(_history != nullptr);
const auto channel = _history->peer->asChannel(); const auto peer = _history->peer;
if (!channel) { if (!peer->asMegagroup() && !peer->asChat()) {
_groupCallTracker = nullptr; _groupCallTracker = nullptr;
_groupCallBar = nullptr; _groupCallBar = nullptr;
return; return;
} }
_groupCallTracker = std::make_unique<HistoryView::GroupCallTracker>( _groupCallTracker = std::make_unique<HistoryView::GroupCallTracker>(
channel); peer);
_groupCallBar = std::make_unique<Ui::GroupCallBar>( _groupCallBar = std::make_unique<Ui::GroupCallBar>(
this, this,
_groupCallTracker->content(), _groupCallTracker->content(),