diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 2fbfdf870..1f35557d8 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1851,7 +1851,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_group_call_no_members" = "No members"; "lng_group_call_members#one" = "{count} member"; "lng_group_call_members#other" = "{count} members"; -"lng_group_call_no_anonymous" = "Anonymous admins can't join voice chats :("; +"lng_group_call_no_anonymous" = "Sorry, anonymous group admins can't join voice chats."; +"lng_group_call_too_many" = "Sorry, there are too many members in this voice chat. Please try again later."; "lng_group_call_context_mute" = "Mute"; "lng_group_call_context_unmute" = "Allow to speak"; "lng_group_call_duration_days#one" = "{count} day"; diff --git a/Telegram/SourceFiles/calls/calls_group_call.cpp b/Telegram/SourceFiles/calls/calls_group_call.cpp index fd057e1e6..cef96ef3b 100644 --- a/Telegram/SourceFiles/calls/calls_group_call.cpp +++ b/Telegram/SourceFiles/calls/calls_group_call.cpp @@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "api/api_send_progress.h" #include "apiwrap.h" #include "lang/lang_keys.h" +#include "lang/lang_hardcoded.h" #include "boxes/confirm_box.h" #include "ui/toasts/common_toasts.h" #include "base/unixtime.h" @@ -230,14 +231,17 @@ void GroupCall::rejoin() { maybeSendMutedUpdate(wasMuteState); _channel->session().api().applyUpdates(updates); }).fail([=](const RPCError &error) { - LOG(("Call Error: Could not join, error: %1" - ).arg(error.type())); + const auto type = error.type(); + LOG(("Call Error: Could not join, error: %1").arg(type)); hangup(); - if (error.type() == u"GROUP_CALL_ANONYMOUS_FORBIDDEN"_q) { - Ui::ShowMultilineToast({ - .text = tr::lng_group_call_no_anonymous(tr::now), - }); - } + + Ui::ShowMultilineToast({ + .text = (type == u"GROUP_CALL_ANONYMOUS_FORBIDDEN"_q + ? tr::lng_group_call_no_anonymous(tr::now) + : type == u"GROUPCALL_PARTICIPANTS_TOO_MUCH"_q + ? tr::lng_group_call_too_many(tr::now) + : Lang::Hard::ServerError()), + }); }).send(); }); });