From 8f387891e264007b2af3f3543d79d467f0a237d8 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 24 Oct 2018 17:40:37 +0400 Subject: [PATCH] Show group / channel in ConfirmInviteBox. --- Telegram/SourceFiles/boxes/confirm_box.cpp | 8 ++++++-- Telegram/SourceFiles/boxes/confirm_box.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp index 38adf076af..76f7453980 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_box.cpp @@ -658,7 +658,8 @@ ConfirmInviteBox::ConfirmInviteBox( const QVector &participants) : _title(this, st::confirmInviteTitle) , _status(this, st::confirmInviteStatus) -, _participants(participants) { +, _participants(participants) +, _isChannel(isChannel) { _title->setText(title); QString status; if (_participants.isEmpty() || _participants.size() >= count) { @@ -694,7 +695,10 @@ ConfirmInviteBox::ConfirmInviteBox( } void ConfirmInviteBox::prepare() { - addButton(langFactory(lng_group_invite_join), [] { + const auto joinKey = _isChannel + ? lng_profile_join_channel + : lng_profile_join_group; + addButton(langFactory(joinKey), [] { if (auto main = App::main()) { main->onInviteImport(); } diff --git a/Telegram/SourceFiles/boxes/confirm_box.h b/Telegram/SourceFiles/boxes/confirm_box.h index c0c0d00090..135072116d 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.h +++ b/Telegram/SourceFiles/boxes/confirm_box.h @@ -220,6 +220,7 @@ private: ImagePtr _photo; std::unique_ptr _photoEmpty; QVector _participants; + bool _isChannel = false; int _userWidth = 0;