Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
Mario Danic 2017-12-21 22:25:46 +01:00
parent 79ac925b1d
commit dfdf479ca3
8 changed files with 27 additions and 9 deletions

View File

@ -12,8 +12,8 @@ android {
targetSdkVersion 27
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
versionCode 6
versionName "0.1.2"
versionCode 7
versionName "0.2.0"
// Enabling multidex support.
multiDexEnabled true

View File

@ -40,6 +40,7 @@ import com.nextcloud.talk.api.helpers.api.ApiHelper;
import com.nextcloud.talk.application.NextcloudTalkApplication;
import com.nextcloud.talk.controllers.base.BaseController;
import com.nextcloud.talk.jobs.PushRegistrationJob;
import com.nextcloud.talk.utils.ErrorMessageHolder;
import com.nextcloud.talk.utils.bundle.BundleKeys;
import com.nextcloud.talk.utils.database.user.UserUtils;
@ -180,6 +181,9 @@ public class AccountVerificationController extends BaseController {
}, throwable -> {
progressText.setText(String.format(getResources().getString(
R.string.nc_nextcloud_talk_app_not_installed), getResources().getString(R.string.nc_app_name)));
ErrorMessageHolder.getInstance().setMessageType(
ErrorMessageHolder.ErrorMessageType.SERVER_WITHOUT_TALK);
abortVerification();
}, () -> dispose(roomsQueryDisposable));

View File

@ -247,11 +247,17 @@ public class ServerSelectionController extends BaseController {
@Override
protected void onAttach(@NonNull View view) {
super.onAttach(view);
if (ErrorMessageHolder.getInstance().getMessageType() != null &&
ErrorMessageHolder.getInstance().getMessageType()
.equals(ErrorMessageHolder.ErrorMessageType.ACCOUNT_SCHEDULED_FOR_DELETION)) {
textFieldBoxes.setError(getResources().getString(R.string.nc_account_scheduled_for_deletion),
false);
if (ErrorMessageHolder.getInstance().getMessageType() != null) {
if (ErrorMessageHolder.getInstance().getMessageType()
.equals(ErrorMessageHolder.ErrorMessageType.ACCOUNT_SCHEDULED_FOR_DELETION)) {
textFieldBoxes.setError(getResources().getString(R.string.nc_account_scheduled_for_deletion),
false);
ErrorMessageHolder.getInstance().setMessageType(null);
} else if (ErrorMessageHolder.getInstance().getMessageType()
.equals(ErrorMessageHolder.ErrorMessageType.SERVER_WITHOUT_TALK)) {
textFieldBoxes.setError(getResources().getString(R.string.nc_settings_no_talk_installed),
false);
}
ErrorMessageHolder.getInstance().setMessageType(null);
}
}

View File

@ -366,6 +366,10 @@ public class SettingsController extends BaseController {
messageText.setText(getResources().getString(R.string.nc_settings_wrong_account));
messageView.setVisibility(View.VISIBLE);
break;
case SERVER_WITHOUT_TALK:
messageText.setTextColor(getResources().getColor(R.color.nc_darkRed));
messageText.setText(getResources().getString(R.string.nc_settings_wrong_account));
messageView.setVisibility(View.VISIBLE);
default:
messageView.setVisibility(View.GONE);
break;

View File

@ -39,7 +39,7 @@ public class ErrorMessageHolder {
}
public enum ErrorMessageType {
WRONG_ACCOUNT, ACCOUNT_UPDATED_NOT_ADDED, ACCOUNT_SCHEDULED_FOR_DELETION
WRONG_ACCOUNT, ACCOUNT_UPDATED_NOT_ADDED, ACCOUNT_SCHEDULED_FOR_DELETION, SERVER_WITHOUT_TALK
}

View File

@ -96,6 +96,7 @@ public class PushUtils {
NextcloudTalkApplication.getSharedApplication().getComponentApplication().inject(this);
keysFile = NextcloudTalkApplication.getSharedApplication().getDir("PushKeyStore", Context.MODE_PRIVATE);
publicKeyFile = new File(NextcloudTalkApplication.getSharedApplication().getDir("PushKeystore",
Context.MODE_PRIVATE), "push_key.pub");
privateKeyFile = new File(NextcloudTalkApplication.getSharedApplication().getDir("PushKeystore",

View File

@ -56,6 +56,7 @@ public class MagicTrustManager implements X509TrustManager {
public MagicTrustManager() {
keystoreFile = new File(NextcloudTalkApplication.getSharedApplication().getDir("CertsKeystore",
Context.MODE_PRIVATE), "keystore.bks");
try {
trustedKeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
FileInputStream fileInputStream = new FileInputStream(keystoreFile);

View File

@ -17,7 +17,7 @@
<string name="nc_display_name_fetched">Display name fetched</string>
<string name="nc_display_name_not_fetched">Display name couldn\'t be fetched, aborting</string>
<string name="nc_nextcloud_talk_app_installed">%1$s app found</string>
<string name="nc_nextcloud_talk_app_not_installed">%1$s app not installed, aborting</string>
<string name="nc_nextcloud_talk_app_not_installed">%1$s app not installed on the server, aborting</string>
<string name="nc_display_name_stored">Display name stored</string>
<string name="nc_display_name_not_stored">Could not store display name, aborting</string>
@ -48,6 +48,8 @@
<string name="nc_settings_remove_account">Remove account</string>
<string name="nc_settings_add_account">Add a new account</string>
<string name="nc_settings_wrong_account">Only current account can be reauthorized</string>
<string name="nc_settings_no_talk_installed">Talk app is not installed on the server you tried to authorize
against</string>
<string name="nc_settings_account_updated">Your already existing account was updated, instead of adding a new one</string>
<string name="nc_account_scheduled_for_deletion">The account is scheduled for deletion, and cannot be changed</string>