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
|
if (LinphonePreferences.instance().getLinkPopupTime() != null
|
||||||
&& Long.parseLong(LinphonePreferences.instance().getLinkPopupTime()) >= now) return;
|
&& 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 =
|
long future =
|
||||||
new Timestamp(
|
new Timestamp(
|
||||||
mContext.getResources()
|
mContext.getResources()
|
||||||
|
@ -609,9 +613,7 @@ public class LinphoneManager implements SensorEventListener {
|
||||||
mContext,
|
mContext,
|
||||||
String.format(
|
String.format(
|
||||||
getString(R.string.link_account_popup),
|
getString(R.string.link_account_popup),
|
||||||
mCore.getDefaultProxyConfig()
|
proxyConfig.getIdentityAddress().asStringUriOnly()));
|
||||||
.getIdentityAddress()
|
|
||||||
.asStringUriOnly()));
|
|
||||||
Button delete = dialog.findViewById(R.id.dialog_delete_button);
|
Button delete = dialog.findViewById(R.id.dialog_delete_button);
|
||||||
delete.setVisibility(View.GONE);
|
delete.setVisibility(View.GONE);
|
||||||
Button ok = dialog.findViewById(R.id.dialog_ok_button);
|
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");
|
Log.e("[Account Linking] Proxy doesn't have an identity address");
|
||||||
unexpectedError();
|
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());
|
mAccountCreator.setUsername(identity.getUsername());
|
||||||
|
|
||||||
AuthInfo authInfo = mProxyConfig.findAuthInfo();
|
AuthInfo authInfo = mProxyConfig.findAuthInfo();
|
||||||
|
|
|
@ -670,6 +670,9 @@ public class AccountSettingsFragment extends SettingsFragment {
|
||||||
if (proxy != null) {
|
if (proxy != null) {
|
||||||
mTransport.setValue(proxy.getTransport().toInt());
|
mTransport.setValue(proxy.getTransport().toInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mLinkAccount.setEnabled(
|
||||||
|
mProxyConfig.getDomain().equals(getString(R.string.default_domain)));
|
||||||
}
|
}
|
||||||
|
|
||||||
setListeners();
|
setListeners();
|
||||||
|
|
Loading…
Reference in a new issue