Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/0.9.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarty committed Sep 10, 2019
2 parents 4dc4125 + b2f4ed4 commit f04ca01
Show file tree
Hide file tree
Showing 27 changed files with 2,477 additions and 166 deletions.
17 changes: 15 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,30 @@
# Build debug version of the Riot application, from the develop branch and the features branches, with the develop branch of the matrix SDK

steps:
- label: "Assemble Debug version"
- label: "Assemble GPlay Debug version"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build is long
queue: "medium"
commands:
- "./set_debug_env.sh"
- "./gradlew clean lintAppRelease assembleAppDebug --stacktrace"
- "./gradlew lintAppfdroidRelease assembleAppfdroidDebug --stacktrace"
artifact_paths:
- "vector/build/outputs/apk/app/debug/*.apk"
branches: "develop feature/*"
plugins:
- docker#v3.1.0:
image: "runmymind/docker-android-sdk"

- label: "Assemble FDroid Debug version"
agents:
# We use a medium sized instance instead of the normal small ones because
# gradle build is long
queue: "medium"
commands:
- "./set_debug_env.sh"
- "./gradlew clean lintAppfdroidRelease assembleAppfdroidDebug --stacktrace"
artifact_paths:
- "vector/build/outputs/apk/appfdroid/debug/*.apk"
branches: "develop feature/*"
plugins:
Expand Down
15 changes: 15 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Changes in Riot 0.9.5 (2019-09-10)
===================================================

Features:
- Auto configure homeserver and identity server URLs of LoginActivity with a magic link (#3294)

Improvements:
- Handle correctly the error 404 when entering a homeserver URL on the login screen

Bugfix:
- Restore correctly the login form when coming back from SSO login form.

Translations:
- Riot is fully translated into Korean thanks to paijai.

Changes in Riot 0.9.4 (2019-08-28)
===================================================

Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ buildscript {

// global properties used in sub modules
ext {
versionCodeProp = 90400
versionNameProp = "0.9.4"
versionCodeProp = 90500
versionNameProp = "0.9.5"
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
buildNumberProp = "${versionBuild}"
}
Expand Down
3 changes: 1 addition & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ org.gradle.jvmargs=-Xmx4g -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

file.encoding=utf-8

org.gradle.daemon=false
org.gradle.parallel=true
org.gradle.configureondemand=false
android.useAndroidX=true
android.enableJetifier=true
Expand Down
3 changes: 3 additions & 0 deletions tools/tests/test_configuration_link.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

adb shell am start -a android.intent.action.VIEW -d "https://riot.im/config/config?hs_url=https%3A%2F%2Fexample.modular.im\&is_url=https%3A%2F%2Fcustom.identity.org"
2 changes: 1 addition & 1 deletion vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ dependencies {
implementation 'com.binaryfork:spanny:1.0.4'
implementation 'com.github.chrisbanes:PhotoView:2.1.4'

// Epoxy (without androidx packages)
// Epoxy
implementation 'com.airbnb.android:epoxy:3.7.0'
kapt 'com.airbnb.android:epoxy-processor:3.7.0'

Expand Down
1 change: 1 addition & 0 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@
<data android:pathPrefix="/beta/" />
<data android:pathPrefix="/develop/" />
<data android:pathPrefix="/staging/" />
<data android:pathPrefix="/config/" />
<!-- mail validation -->
<data android:pathPrefix="/_matrix/" />
</intent-filter>
Expand Down
62 changes: 41 additions & 21 deletions vector/src/main/java/im/vector/activity/LoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
import im.vector.activity.util.RequestCodesKt;
import im.vector.features.hhs.ResourceLimitDialogHelper;
import im.vector.push.fcm.FcmHelper;
import im.vector.receiver.LoginConfig;
import im.vector.receiver.VectorRegistrationReceiver;
import im.vector.receiver.VectorUniversalLinkReceiver;
import im.vector.repositories.ServerUrlsRepository;
Expand All @@ -117,6 +118,7 @@ public class LoginActivity extends MXCActionBarActivity implements RegistrationM


public static final String EXTRA_RESTART_FROM_INVALID_CREDENTIALS = "EXTRA_RESTART_FROM_INVALID_CREDENTIALS";
public static final String EXTRA_CONFIG = "EXTRA_CONFIG";


// activity modes
Expand Down Expand Up @@ -375,7 +377,7 @@ public void onReceive(Context context, Intent intent) {
if (networkInfo != null && networkInfo.isConnected()) {
// refresh only once
if (mIsWaitingNetworkConnection) {
refreshDisplay();
refreshDisplay(true);
} else {
removeNetworkStateNotificationListener();
}
Expand Down Expand Up @@ -581,7 +583,7 @@ public void onFocusChange(View v, boolean hasFocus) {
@Override
public void onClick(View view) {
mMode = MODE_FORGOT_PASSWORD;
refreshDisplay();
refreshDisplay(true);
}
});

Expand All @@ -601,7 +603,7 @@ public void run() {
mIdentityServerUrl = null;
onIdentityServerUrlUpdate(false);
onHomeServerUrlUpdate(false);
refreshDisplay();
refreshDisplay(true);
}
});
}
Expand Down Expand Up @@ -722,6 +724,14 @@ public void afterTextChanged(Editable s) {
}
}
});

// Get config extra
LoginConfig loginConfig = getIntent().getParcelableExtra(EXTRA_CONFIG);
if (isFirstCreation() && loginConfig != null) {
mHomeServerText.setText(loginConfig.getHomeServerUrl());
mIdentityServerText.setText(loginConfig.getIdentityServerUrl());
mUseCustomHomeServersCheckbox.performClick();
}
}

private void tryAutoDiscover(String possibleDomain) {
Expand Down Expand Up @@ -990,7 +1000,7 @@ protected void onResume() {
mUseCustomHomeServersCheckbox.setChecked(true);
}

refreshDisplay();
refreshDisplay(true);
}

/**
Expand All @@ -1009,7 +1019,7 @@ private void fallbackToLoginMode() {
enableLoadingScreen(false);

mMode = MODE_LOGIN;
refreshDisplay();
refreshDisplay(true);
}

/**
Expand All @@ -1024,7 +1034,7 @@ private void fallbackToRegistrationMode() {
enableLoadingScreen(false);

mMode = MODE_ACCOUNT_CREATION;
refreshDisplay();
refreshDisplay(true);
}

@Override
Expand Down Expand Up @@ -1186,7 +1196,7 @@ public void onSuccess(ThreePid thirdPid) {
hideMainLayoutAndToast(getString(R.string.auth_reset_password_email_validation_message, email));

mMode = MODE_FORGOT_PASSWORD_WAITING_VALIDATION;
refreshDisplay();
refreshDisplay(true);

mForgotPid = new ThreePidCredentials();
mForgotPid.clientSecret = thirdPid.clientSecret;
Expand Down Expand Up @@ -1263,7 +1273,7 @@ private void onForgotOnEmailValidated(final HomeServerConnectionConfig hsConfig)
mIsPasswordReset = false;
mMode = MODE_LOGIN;
showMainLayout();
refreshDisplay();
refreshDisplay(true);
} else {
ProfileRestClient profileRestClient = new ProfileRestClient(hsConfig);
enableLoadingScreen(true);
Expand All @@ -1281,7 +1291,7 @@ public void onSuccess(Void info) {
// refresh the messages
hideMainLayoutAndToast(getString(R.string.auth_reset_password_success_message));
mIsPasswordReset = true;
refreshDisplay();
refreshDisplay(true);
}
}

Expand All @@ -1301,7 +1311,7 @@ private void onError(String errorMessage, boolean cancel) {
if (cancel) {
showMainLayout();
mMode = MODE_LOGIN;
refreshDisplay();
refreshDisplay(true);
}
}
}
Expand Down Expand Up @@ -1514,7 +1524,7 @@ private void errorHandler(String errorMessage) {
enableLoadingScreen(false);
setActionButtonsEnabled(false);
showMainLayout();
refreshDisplay();
refreshDisplay(true);
Toast.makeText(getApplicationContext(), errorMessage, Toast.LENGTH_LONG).show();
}

Expand Down Expand Up @@ -1737,7 +1747,7 @@ public void onMatrixError(MatrixError e) {
private void onRegistrationNotAllowed() {
// Registration not supported by the server
mMode = MODE_LOGIN;
refreshDisplay();
refreshDisplay(true);

mSwitchToRegisterButton.setVisibility(View.GONE);
}
Expand Down Expand Up @@ -1774,7 +1784,7 @@ void onSwitchToRegisterClick() {
// the user switches to another mode
if (mMode != MODE_ACCOUNT_CREATION) {
mMode = MODE_ACCOUNT_CREATION;
refreshDisplay();
refreshDisplay(true);
}
}

Expand Down Expand Up @@ -1883,7 +1893,7 @@ void onSwitchToLoginClick() {
showMainLayout();

mMode = MODE_LOGIN;
refreshDisplay();
refreshDisplay(true);
}
}

Expand Down Expand Up @@ -2079,8 +2089,10 @@ public void onSuccess(List<LoginFlow> flows) {
if (isSsoDetected) {
// SSO has priority over password
mMode = MODE_LOGIN_SSO;
refreshDisplay();
refreshDisplay(true);
} else if (isTypePasswordDetected) {
// In case we were previously in SSO mode
refreshDisplay(false);
if (mIsPendingLogin) {
onLoginClick();
}
Expand Down Expand Up @@ -2116,7 +2128,13 @@ public void onNetworkError(Exception e) {

@Override
public void onUnexpectedError(Exception e) {
onError(getString(R.string.login_error_unable_login) + " : " + e.getLocalizedMessage());
// Handle correctly the 404, the Matrix SDK should be patched later
if (e instanceof HttpException
&& ((HttpException) e).getHttpError().getHttpCode() == HttpsURLConnection.HTTP_NOT_FOUND /* 404 */) {
onError(getString(R.string.login_error_homeserver_not_found));
} else {
onError(getString(R.string.login_error_unable_login) + " : " + e.getLocalizedMessage());
}
}

@Override
Expand Down Expand Up @@ -2185,9 +2203,11 @@ public void onSaveInstanceState(Bundle savedInstanceState) {
/**
* Refresh the visibility of mHomeServerText
*/
private void refreshDisplay() {
private void refreshDisplay(boolean checkFlow) {
// check if the device supported the dedicated mode
checkFlows();
if (checkFlow) {
checkFlows();
}

TransitionManager.beginDelayedTransition(mMainContainer);

Expand Down Expand Up @@ -2678,7 +2698,7 @@ public void onRegistrationFailed(String message) {
Log.e(LOG_TAG, "## onRegistrationFailed(): " + message);
showMainLayout();
enableLoadingScreen(false);
refreshDisplay();
refreshDisplay(true);
Toast.makeText(this, R.string.login_error_unable_register, Toast.LENGTH_LONG).show();
}

Expand Down Expand Up @@ -2735,7 +2755,7 @@ public void onThreePidRequestFailed(String message) {
Log.d(LOG_TAG, "## onThreePidRequestFailed():" + message);
enableLoadingScreen(false);
showMainLayout();
refreshDisplay();
refreshDisplay(true);
Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
}

Expand All @@ -2751,7 +2771,7 @@ public void onUsernameAvailabilityChecked(boolean isAvailable) {
showMainLayout();
mMode = MODE_ACCOUNT_CREATION_THREE_PID;
initThreePidView();
refreshDisplay();
refreshDisplay(true);
} else {
// Start registration
createAccount();
Expand Down
Loading

0 comments on commit f04ca01

Please sign in to comment.