Check phone access on join.

This commit is contained in:
John Preston 2025-04-05 10:12:32 +04:00
parent 8ab1a7268b
commit 344c0f6427
4 changed files with 18 additions and 6 deletions

View file

@ -4957,6 +4957,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_confcall_invite_kicked_user" = "{user} was removed from the call.";
"lng_confcall_invite_kicked_many#one" = "**{count} person** was removed from the call.";
"lng_confcall_invite_kicked_many#other" = "**{count} people** were removed from the call.";
"lng_confcall_not_accessible" = "This call is no longer accessible.";
"lng_no_mic_permission" = "Telegram needs microphone access so that you can make calls and record voice messages.";

View file

@ -1643,8 +1643,8 @@ void GroupCall::sendJoinRequest() {
hangup();
Ui::Toast::Show((type == u"GROUPCALL_FORBIDDEN"_q)
? tr::lng_group_not_accessible(tr::now)
: Lang::Hard::ServerError());
? tr::lng_confcall_not_accessible(tr::now)
: type);
}).send();
}

View file

@ -300,8 +300,9 @@ void ShowConferenceCallLinkBox(
show->showToast({
.title = tr::lng_confcall_link_revoked_title(
tr::now),
.text = tr::lng_confcall_link_revoked_text(
tr::now),
.text = {
tr::lng_confcall_link_revoked_text(tr::now),
},
});
};
ExportConferenceCallLink(

View file

@ -876,7 +876,7 @@ void SessionNavigation::resolveConferenceCall(
const auto slug = base::take(_conferenceCallSlug);
const auto inviteMsgId = base::take(_conferenceCallInviteMsgId);
const auto contextId = base::take(_conferenceCallResolveContextId);
result.data().vcall().match([&](const auto &data) {
result.data().vcall().match([&](const MTPDgroupCall &data) {
const auto call = session().data().sharedConferenceCall(
data.vid().v,
data.vaccess_hash().v);
@ -897,12 +897,22 @@ void SessionNavigation::resolveConferenceCall(
call,
(inviter && !inviter->isSelf()) ? inviter : nullptr,
join));
}, [&](const MTPDgroupCallDiscarded &data) {
if (inviteMsgId) {
showToast(tr::lng_confcall_not_accessible(tr::now));
} else {
showToast(tr::lng_confcall_link_inactive(tr::now));
}
});
}).fail([=] {
_conferenceCallRequestId = 0;
_conferenceCallSlug = QString();
_conferenceCallResolveContextId = FullMsgId();
showToast(tr::lng_confcall_link_inactive(tr::now));
if (base::take(_conferenceCallResolveContextId)) {
showToast(tr::lng_confcall_not_accessible(tr::now));
} else {
showToast(tr::lng_confcall_link_inactive(tr::now));
}
}).send();
}