Add invalid call link dialog.

This commit is contained in:
Alex Hart
2023-08-08 16:23:54 -03:00
parent 748667a0b4
commit c479dd404c
2 changed files with 14 additions and 0 deletions

View File

@@ -335,9 +335,19 @@ public class CommunicationActions {
}
public static void handlePotentialCallLinkUrl(@NonNull FragmentActivity activity, @NonNull String potentialUrl) {
if (!FeatureFlags.adHocCalling()) {
Toast.makeText(activity, R.string.CommunicationActions_cant_join_call, Toast.LENGTH_SHORT).show();
return;
}
CallLinkRootKey rootKey = CallLinks.parseUrl(potentialUrl);
if (rootKey == null) {
Log.w(TAG, "Failed to parse root key from call link");
new MaterialAlertDialogBuilder(activity)
.setTitle(R.string.CommunicationActions_invalid_link)
.setMessage(R.string.CommunicationActions_this_is_not_a_valid_call_link)
.setPositiveButton(android.R.string.ok, null)
.show();
return;
}

View File

@@ -242,6 +242,10 @@
<string name="CommunicationActions_carrier_charges_may_apply">Carrier charges may apply. The number you are calling is not registered with Signal. This call will be placed through your mobile carrier, not over the internet.</string>
<string name="CommunicationActions_cant_join_call">Can\'t join call</string>
<string name="CommunicationActions_this_call_link_is_no_longer_valid">This call link is no longer valid.</string>
<!-- Title on dialog when call link url cannot be parsed -->
<string name="CommunicationActions_invalid_link">Invalid link</string>
<!-- Message on dialog when call link url cannot be parsed -->
<string name="CommunicationActions_this_is_not_a_valid_call_link">This is not a valid call link. Make sure the entire link is intact and correct before attempting to join.</string>
<!-- ConfirmIdentityDialog -->