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_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#one" = "**{count} person** was removed from the call.";
"lng_confcall_invite_kicked_many#other" = "**{count} people** were 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."; "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(); hangup();
Ui::Toast::Show((type == u"GROUPCALL_FORBIDDEN"_q) Ui::Toast::Show((type == u"GROUPCALL_FORBIDDEN"_q)
? tr::lng_group_not_accessible(tr::now) ? tr::lng_confcall_not_accessible(tr::now)
: Lang::Hard::ServerError()); : type);
}).send(); }).send();
} }

View file

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

View file

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