Prevent account linking on non sip.linphone.org proxy configs
This commit is contained in:
parent
7cfd739186
commit
6187466b06
3 changed files with 12 additions and 3 deletions
|
@ -594,6 +594,10 @@ public class LinphoneManager implements SensorEventListener {
|
|||
if (LinphonePreferences.instance().getLinkPopupTime() != null
|
||||
&& Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) >= now) return;
|
||||
|
||||
ProxyConfig proxyConfig = mCore.getDefaultProxyConfig();
|
||||
if (proxyConfig == null) return;
|
||||
if (!proxyConfig.getDomain().equals(getString(R.string.default_domain))) return;
|
||||
|
||||
long future =
|
||||
new Timestamp(
|
||||
mContext.getResources()
|
||||
|
@ -609,9 +613,7 @@ public class LinphoneManager implements SensorEventListener {
|
|||
mContext,
|
||||
String.format(
|
||||
getString(R.string.link_account_popup),
|
||||
mCore.getDefaultProxyConfig()
|
||||
.getIdentityAddress()
|
||||
.asStringUriOnly()));
|
||||
proxyConfig.getIdentityAddress().asStringUriOnly()));
|
||||
Button delete = dialog.findViewById(R.id.dialog_delete_button);
|
||||
delete.setVisibility(View.GONE);
|
||||
Button ok = dialog.findViewById(R.id.dialog_ok_button);
|
||||
|
|
|
@ -72,6 +72,10 @@ public class PhoneAccountLinkingAssistantActivity extends AssistantActivity {
|
|||
Log.e("[Account Linking] Proxy doesn't have an identity address");
|
||||
unexpectedError();
|
||||
}
|
||||
if (!mProxyConfig.getDomain().equals(getString(R.string.default_domain))) {
|
||||
Log.e("[Account Linking] Can't link account on domain " + mProxyConfig.getDomain());
|
||||
unexpectedError();
|
||||
}
|
||||
mAccountCreator.setUsername(identity.getUsername());
|
||||
|
||||
AuthInfo authInfo = mProxyConfig.findAuthInfo();
|
||||
|
|
|
@ -670,6 +670,9 @@ public class AccountSettingsFragment extends SettingsFragment {
|
|||
if (proxy != null) {
|
||||
mTransport.setValue(proxy.getTransport().toInt());
|
||||
}
|
||||
|
||||
mLinkAccount.setEnabled(
|
||||
mProxyConfig.getDomain().equals(getString(R.string.default_domain)));
|
||||
}
|
||||
|
||||
setListeners();
|
||||
|
|
Loading…
Reference in a new issue