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

Commit

Permalink
Rebase from vector-im/riot-android
Browse files Browse the repository at this point in the history
Update matrix-sdk.aar lib - build 1875 - Revision: ccf12449b8f09b06a7a8f501b9d7a382270b2305

Last rebase was performed June 1 2018. Here is the list of changes from vector-im/riot-android changes:

Changes in Riot 0.8.XX (2018-08-24)
===================================================

Features:
 - Manage server quota notices (#2440)

Improvements:
 - Do not ask permission to write external storage at startup (#2483)
 - Update settings icon and transparent logo for notifications and navigation drawer (#2492)
 - URL previews are no longer requested from the server when displaying URL previews is disabled (PR #2514)
 - Fix some plural and puzzle strings, and remove other unused ones (#2444)
 - Manage System Alerts in a dedicated section

Other changes:
 - Upgrade olm-sdk.aar from version 2.2.2 to version 2.3.0
 - move PieFractionView from the SDK to the client (#2525)

Bugfix:
 - Fix media sharing (#2530)
 - Fix notification sound issue in settings (#2524)
 - Disable app icon badge for "listen for event" notification (#2104)

Changes in Riot 0.8.13 (2018-08-09)
===================================================

Features:
 - Resurrect performance metrics (#2391)
 - Telemetry to report incidence of UISIs (#2330)
 - Add a previewer for previewing media before sending it into the room (#1742|#2445)
 - Implements ReplyTo feature (#2390)
 - Add auto completion for slash commands (#2384)
 - Support Room Versioning (#2441)

Improvements:
 - Update matrix-sdk.aar lib (v0.9.7).
 - Piwik: Update the way how stats are reported (#2402)
 - Improve BugReport screen: display a preview of the screenshot (#2318)
 - In the settings, move theme settings just below "language" (#2439)
 - Improve the display of the sources of the message in the dialog (#2348)
 - Improve the display of the buttons and the reason in the room preview (#2352)
 - In the flair section on settings, notify the user when he has no flair (#2430)
 - Improve GDPR consent webview management (#2491)
 - Support external keyboard to send messages for recent devices (#220, #1279)
 - When user ignores or un-ignores someone, notify that the app will restart (#2437)

Other changes:
 - Remove dependency to `android-gif-drawable` lib and use Glide to animate logo on Splashscreen (#2421)
 - Keep only Room.getState() method and remove Room.getLiveState() because they are similar (matrix-org/matrix-android-sdk#310)

Bugfix:
 - Fix issue on incoming call screen when "Do not disturb mode" is active (#2417)
 - Fix issue when selecting sound for notifications in the settings
 - Fix issue when changing device name in the settings (#2416)
 - Fix issue on verifying device, update the wording of the description message (#1067)
 - Messages with code blocks show other HTML as plain text (#2280)
 - Message with <p> was sometimes not properly formatted (#2275)
 - Fix notification issue when Riot is not started (#2451)
 - Fix Unable to add Matrix apps (#2466)
 - Riot auto joined a public room (#2472)
 - Remove last traces of Firebase analytics (#2481)
 - code blocks are escaped and therefore hard readable (#2484)
 - Restore the navigation of the back button in the public rooms preview header (#2473)
 - Fix issue on preference screen: device lists was not displayed (#2409)
 - Ensure notification has a title (#2242)

Changes in Riot 0.8.12 (2018-07-06)
===================================================

Bugfix:
 - Fix issue on vanished favorite and low priority room (#2413)

Changes in Riot 0.8.11 (2018-07-03)
===================================================

Features:
 - Re-request keys manually for encrypted events (#2319)
 - Add option to send voice message to a room, using a third application to record message.
   To enable in the Labs settings (PR #1762)

Improvements:
 - Update matrix-sdk.aar lib (v0.9.6).
 - New Floating Action Menu in Home screen (PR #2335)
 - Add spacing to device keys (#2314)
 - use apply() instead of commit() to save shared prefs (#2231)
 - Do not ring if "Do Not Disturb" is active (#1072)
 - Manage the "consent not given" error when declining a room invite

Other changes:
 - Remove "Matrix application" activation from the Lab section in the settings (#2341)

Bugfix:
 - Remove black borders on 18:9 phone (#2063)
 - Auto dismiss the join/reject room notification when user select an action (#2354)
 - Fix some crashes reported by the PlayStore (#2380, #2382, #2383, #2395)
 - Fix issues in UrlPreviews (#2312)

Translations:
 - Galician thanks to Miguel Branco

Build:
 - Add script to check code quality
 - Travis will now check if CHANGES.rst has been modified for each PR

------

Merge commit '94b7925a57b800db62b5ec87966d994ff53392b4' into develop

# Conflicts:
#	vector/src/main/java/im/vector/activity/VectorRoomActivity.java
#	vector/src/main/java/im/vector/adapters/VectorMediasViewerAdapter.java
#	vector/src/main/java/im/vector/db/VectorContentProvider.java
#	vector/src/main/java/im/vector/dialogs/ConsentNotGivenHelper.kt
#	vector/src/main/java/im/vector/fragments/VectorSettingsPreferencesFragment.kt
#	vector/src/main/res/values/strings.xml
#	vector/src/main/res/values/styles.xml
  • Loading branch information
giomfo committed Aug 25, 2018
2 parents d1fb2d8 + 94b7925 commit 5557a8c
Show file tree
Hide file tree
Showing 71 changed files with 1,043 additions and 678 deletions.
7 changes: 5 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ Changes in Riot 0.8.14 (2018-XX-XX)
===================================================

Features:
-
- Manage server quota notices (#2440)

Improvements:
- Do not ask permission to write external storage at startup (#2483)
- Update settings icon and transparent logo for notifications and navigation drawer (#2492)
- URL previews are no longer requested from the server when displaying URL previews is disabled (PR #2514)
- Fix some plural and puzzle strings, and remove other unused ones (#2444)
- Manage System Alerts in a dedicated section

Other changes:
- Upgrade olm-sdk.aar from version 2.2.2 to version 2.3.0
- move PieFractionView from the SDK to the client (#2525)

Bugfix:
-
- Fix media sharing (#2530)
- Fix notification sound issue in settings (#2524)
- Disable app icon badge for "listen for event" notification (#2104)

Translations:
-
Expand Down
Binary file modified vector/libs/matrix-sdk.aar
Binary file not shown.
51 changes: 35 additions & 16 deletions vector/src/main/java/fr/gouv/tchap/activity/TchapLoginActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import im.vector.activity.FallbackLoginActivity;
import im.vector.activity.MXCActionBarActivity;
import im.vector.activity.SplashActivity;
import im.vector.dialogs.ResourceLimitDialogHelper;
import im.vector.receiver.VectorRegistrationReceiver;
import im.vector.receiver.VectorUniversalLinkReceiver;
import im.vector.services.EventStreamService;
Expand Down Expand Up @@ -271,6 +272,8 @@ public void onReceive(Context context, Intent intent) {
}
};

private ResourceLimitDialogHelper mResourceLimitDialogHelper;

private boolean mIsWaitingNetworkConnection = false;

/**
Expand Down Expand Up @@ -455,9 +458,14 @@ public void onClick(View view) {
}
});

if (!isFirstCreation()) {
restoreSavedData(getSavedInstanceState());
if (isFirstCreation()) {
mResourceLimitDialogHelper = new ResourceLimitDialogHelper(this, null);
} else {
final Bundle savedInstanceState = getSavedInstanceState();
mResourceLimitDialogHelper = new ResourceLimitDialogHelper(this, savedInstanceState);
restoreSavedData(savedInstanceState);
}
addToRestorables(mResourceLimitDialogHelper);

refreshDisplay();

Expand Down Expand Up @@ -983,32 +991,37 @@ public void onUnexpectedError(Exception e) {
* @param matrixError the matrix error
*/
private void onFailureDuringAuthRequest(MatrixError matrixError) {
String message = matrixError.getLocalizedMessage();
enableLoadingScreen(false);

// detect if it is a Matrix SDK issue
String errCode = matrixError.errcode;
final String errCode = matrixError.errcode;

if (MatrixError.RESOURCE_LIMIT_EXCEEDED.equals(errCode)) {
Log.e(LOG_TAG, "## onFailureDuringAuthRequest(): RESOURCE_LIMIT_EXCEEDED");
mResourceLimitDialogHelper.displayDialog(matrixError);
} else {
final String message;

if (null != errCode) {
if (TextUtils.equals(errCode, MatrixError.FORBIDDEN)) {
message = getResources().getString(R.string.login_error_forbidden);
message = getString(R.string.login_error_forbidden);
} else if (TextUtils.equals(errCode, MatrixError.UNKNOWN_TOKEN)) {
message = getResources().getString(R.string.login_error_unknown_token);
message = getString(R.string.login_error_unknown_token);
} else if (TextUtils.equals(errCode, MatrixError.BAD_JSON)) {
message = getResources().getString(R.string.login_error_bad_json);
message = getString(R.string.login_error_bad_json);
} else if (TextUtils.equals(errCode, MatrixError.NOT_JSON)) {
message = getResources().getString(R.string.login_error_not_json);
message = getString(R.string.login_error_not_json);
} else if (TextUtils.equals(errCode, MatrixError.LIMIT_EXCEEDED)) {
message = getResources().getString(R.string.login_error_limit_exceeded);
message = getString(R.string.login_error_limit_exceeded);
} else if (TextUtils.equals(errCode, MatrixError.USER_IN_USE)) {
message = getResources().getString(R.string.login_error_user_in_use);
message = getString(R.string.login_error_user_in_use);
} else if (TextUtils.equals(errCode, MatrixError.LOGIN_EMAIL_URL_NOT_YET)) {
message = getResources().getString(R.string.login_error_login_email_not_yet);
message = getString(R.string.login_error_login_email_not_yet);
} else {
message = matrixError.getLocalizedMessage();
}
}

Log.e(LOG_TAG, "## onFailureDuringAuthRequest(): Msg= \"" + message + "\"");
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
Log.e(LOG_TAG, "## onFailureDuringAuthRequest(): Msg= \"" + message + "\"");
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
}
}

/**
Expand Down Expand Up @@ -2168,6 +2181,12 @@ public void onUsernameAvailabilityChecked(boolean isAvailable) {
}*/
}

@Override
public void onResourceLimitExceeded(MatrixError e) {
enableLoadingScreen(false);
mResourceLimitDialogHelper.displayDialog(e);
}


/*
* *********************************************************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@
import im.vector.PublicRoomsManager;
import im.vector.R;
import im.vector.activity.CommonActivityUtils;
import im.vector.activity.RiotAppCompatActivity;
import fr.gouv.tchap.fragments.TchapPublicRoomsFragment;
import im.vector.activity.VectorAppCompatActivity;

/**
* List all the public rooms by considering all known room directories.
*/
public class TchapPublicRoomSelectionActivity extends RiotAppCompatActivity implements android.support.v7.widget.SearchView.OnQueryTextListener {
public class TchapPublicRoomSelectionActivity extends VectorAppCompatActivity implements android.support.v7.widget.SearchView.OnQueryTextListener {

private static final String LOG_TAG = TchapPublicRoomSelectionActivity.class.getSimpleName();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import im.vector.R;
import im.vector.activity.CommonActivityUtils;
import fr.gouv.tchap.activity.TchapLoginActivity;
import im.vector.activity.RiotAppCompatActivity;
import im.vector.activity.VectorAppCompatActivity;
import im.vector.adapters.ParticipantAdapterItem;
import fr.gouv.tchap.adapters.TchapContactAdapter;
import im.vector.contacts.Contact;
Expand Down Expand Up @@ -276,7 +276,7 @@ public void onSelectItem(Room room, int position) {

@Override
public void onSelectItem(ParticipantAdapterItem contact, int position) {
DinsicUtils.startDirectChat((RiotAppCompatActivity) getActivity(), mSession, contact);
DinsicUtils.startDirectChat((VectorAppCompatActivity) getActivity(), mSession, contact);
}
}, this, this);
mRecycler.setAdapter(mAdapter);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import im.vector.PublicRoomsManager;
import im.vector.R;
import im.vector.activity.CommonActivityUtils;
import im.vector.activity.RiotAppCompatActivity;
import im.vector.activity.VectorAppCompatActivity;
import im.vector.activity.VectorRoomActivity;
import im.vector.adapters.AdapterSection;
import im.vector.fragments.VectorBaseFragment;
Expand All @@ -61,7 +61,7 @@ public class TchapPublicRoomsFragment extends VectorBaseFragment {
private static final String LOG_TAG = TchapPublicRoomsFragment.class.getSimpleName();
private static final String CURRENT_FILTER = "CURRENT_FILTER";

protected RiotAppCompatActivity mActivity;
protected VectorAppCompatActivity mActivity;

protected String mCurrentFilter;

Expand Down Expand Up @@ -104,8 +104,8 @@ public View onCreateView(final LayoutInflater inflater, final ViewGroup containe
public void onActivityCreated(final Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);

if (getActivity() instanceof RiotAppCompatActivity) {
mActivity = (RiotAppCompatActivity) getActivity();
if (getActivity() instanceof VectorAppCompatActivity) {
mActivity = (VectorAppCompatActivity) getActivity();
}
mSession = Matrix.getInstance(getActivity()).getDefaultSession();

Expand Down
8 changes: 4 additions & 4 deletions vector/src/main/java/fr/gouv/tchap/util/DinsicUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
import im.vector.R;
import im.vector.activity.CommonActivityUtils;
import fr.gouv.tchap.activity.TchapLoginActivity;
import im.vector.activity.RiotAppCompatActivity;
import im.vector.activity.VectorAppCompatActivity;
import im.vector.activity.VectorRoomActivity;
import im.vector.adapters.ParticipantAdapterItem;
import im.vector.contacts.Contact;
Expand Down Expand Up @@ -341,7 +341,7 @@ public void onClick(DialogInterface dialog, int id) {
* @param canCreate create the direct chat if it does not exist.
* @return boolean that says if the direct chat room is found or not
*/
public static boolean openDirectChat(final RiotAppCompatActivity activity, String participantId, final MXSession session, boolean canCreate) {
public static boolean openDirectChat(final VectorAppCompatActivity activity, String participantId, final MXSession session, boolean canCreate) {
Room existingRoom = isDirectChatRoomAlreadyExist(participantId, session, true);
boolean succeeded = false;

Expand Down Expand Up @@ -515,7 +515,7 @@ public static Room isDirectChatRoomAlreadyExist(String aUserId, MXSession mSessi
* @param session the current session
* @param selectedContact the selected contact
*/
public static void startDirectChat (final RiotAppCompatActivity activity, final MXSession session, final ParticipantAdapterItem selectedContact) {
public static void startDirectChat (final VectorAppCompatActivity activity, final MXSession session, final ParticipantAdapterItem selectedContact) {
if (selectedContact.mIsValid) {
// Tell if contact is tchap user
if (MXSession.isUserId(selectedContact.mUserId)) {
Expand Down Expand Up @@ -578,7 +578,7 @@ public void onClick(DialogInterface dialog, int id) {
* @param session the current session
* @param selectedUser the selected tchap user
*/
public static void startDirectChat(final RiotAppCompatActivity activity, final MXSession session, User selectedUser) {
public static void startDirectChat(final VectorAppCompatActivity activity, final MXSession session, User selectedUser) {
// Consider here that the provided id is a correct matrix identifier, we don't check again
// Try first to open an existing direct chat
if (!openDirectChat(activity, selectedUser.user_id, session, false)) {
Expand Down
10 changes: 10 additions & 0 deletions vector/src/main/java/im/vector/LoginHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ public void getSupportedLoginFlows(Context ctx, final HomeServerConnectionConfig
LoginRestClient client = new LoginRestClient(hsConfig);

client.getSupportedLoginFlows(new UnrecognizedCertApiCallback<List<LoginFlow>>(hsConfig, callback) {
@Override
public void onSuccess(List<LoginFlow> info) {
callback.onSuccess(info);
}

@Override
public void onAcceptedCert() {
getSupportedLoginFlows(appCtx, hsConfig, callback);
Expand Down Expand Up @@ -221,6 +226,11 @@ public void submitEmailTokenValidation(final Context aCtx,
ThirdPidRestClient restClient = new ThirdPidRestClient(aHomeServerConfig);

pid.submitValidationToken(restClient, aToken, aClientSecret, aSid, new UnrecognizedCertApiCallback<Boolean>(aHomeServerConfig, aRespCallback) {
@Override
public void onSuccess(Boolean info) {
aRespCallback.onSuccess(info);
}

@Override
public void onAcceptedCert() {
submitEmailTokenValidation(aCtx, aHomeServerConfig, aToken, aClientSecret, aSid, aRespCallback);
Expand Down
22 changes: 22 additions & 0 deletions vector/src/main/java/im/vector/RegistrationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ public void onRegistrationSuccess() {
public void onRegistrationFailed(String message) {
listener.onUsernameAvailabilityChecked(!TextUtils.equals(MatrixError.USER_IN_USE, message));
}

@Override
public void onResourceLimitExceeded(MatrixError e) {
// Should not happen, consider user is available, registration will fail later on
listener.onUsernameAvailabilityChecked(true);
}
});
}
}
Expand Down Expand Up @@ -352,6 +358,11 @@ public void onRegistrationFailed(String message) {
listener.onRegistrationFailed(message);
}
}

@Override
public void onResourceLimitExceeded(MatrixError e) {
listener.onResourceLimitExceeded(e);
}
});
} else {
// TODO Report this fix in Riot
Expand Down Expand Up @@ -404,6 +415,11 @@ public void onRegistrationFailed(String message) {
listener.onRegistrationFailed(message);
}
}

@Override
public void onResourceLimitExceeded(MatrixError e) {
listener.onResourceLimitExceeded(e);
}
});
}

Expand Down Expand Up @@ -977,6 +993,8 @@ public void onMatrixError(MatrixError e) {
Log.e(LOG_TAG, "JsonUtils.toRegistrationFlowResponse " + castExcept.getLocalizedMessage(), castExcept);
}
listener.onRegistrationFailed(ERROR_MISSING_STAGE);
} else if (TextUtils.equals(e.errcode, MatrixError.RESOURCE_LIMIT_EXCEEDED)) {
listener.onResourceLimitExceeded(e);
} else {
listener.onRegistrationFailed("");
}
Expand All @@ -995,6 +1013,8 @@ private interface InternalRegistrationListener {
void onRegistrationSuccess();

void onRegistrationFailed(String message);

void onResourceLimitExceeded(MatrixError e);
}

/*
Expand Down Expand Up @@ -1027,5 +1047,7 @@ public interface RegistrationListener {
void onWaitingCaptcha();

void onThreePidRequestFailed(String message);

void onResourceLimitExceeded(MatrixError e);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/**
* Handle certificate errors in API callbacks
*/
public class UnrecognizedCertApiCallback<T> extends SimpleApiCallback<T> {
public abstract class UnrecognizedCertApiCallback<T> extends SimpleApiCallback<T> {

private HomeServerConnectionConfig mHsConfig;
private ApiCallback mCallback;
Expand All @@ -27,9 +27,7 @@ public UnrecognizedCertApiCallback(HomeServerConnectionConfig hsConfig) {
*
* The usual behavior is to play the request again
*/
public void onAcceptedCert() {

}
public abstract void onAcceptedCert();

/**
* The request failed because of an unknown TLS certificate or a network error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import java.util.*
*
* Layout MUST contains a WebView with ID 'widget_webview'
*/
abstract class AbstractWidgetActivity : RiotAppCompatActivity() {
abstract class AbstractWidgetActivity : VectorAppCompatActivity() {

/* ==========================================================================================
* UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/**
* AccountCreationActivity is the fallback account creation activity
*/
public class AccountCreationActivity extends RiotAppCompatActivity {
public class AccountCreationActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = AccountCreationActivity.class.getSimpleName();

public static final String EXTRA_HOME_SERVER_ID = "AccountCreationActivity.EXTRA_HOME_SERVER_ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
/**
* AccountCreationCaptchaActivity displays a webview to check captchas.
*/
public class AccountCreationCaptchaActivity extends RiotAppCompatActivity {
public class AccountCreationCaptchaActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = AccountCreationCaptchaActivity.class.getSimpleName();

public static final String EXTRA_HOME_SERVER_URL = "AccountCreationCaptchaActivity.EXTRA_HOME_SERVER_URL";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import im.vector.util.ThemeUtils;
import kotlin.Pair;

public class CountryPickerActivity extends RiotAppCompatActivity implements CountryAdapter.OnSelectCountryListener, SearchView.OnQueryTextListener {
public class CountryPickerActivity extends VectorAppCompatActivity implements CountryAdapter.OnSelectCountryListener, SearchView.OnQueryTextListener {

private static final String EXTRA_IN_WITH_INDICATOR = "EXTRA_IN_WITH_INDICATOR";
public static final String EXTRA_OUT_COUNTRY_NAME = "EXTRA_OUT_COUNTRY_NAME";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import org.matrix.androidsdk.rest.model.MatrixError
/**
* Displays the Account deactivation screen.
*/
class DeactivateAccountActivity : RiotAppCompatActivity() {
class DeactivateAccountActivity : VectorAppCompatActivity() {

/* ==========================================================================================
* UI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* FallbackLoginActivity is the fallback login activity
* i.e this activity is created when the client does not support the
*/
public class FallbackLoginActivity extends RiotAppCompatActivity {
public class FallbackLoginActivity extends VectorAppCompatActivity {
private static final String LOG_TAG = FallbackLoginActivity.class.getSimpleName();

public static final String EXTRA_HOME_SERVER_ID = "FallbackLoginActivity.EXTRA_HOME_SERVER_ID";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
/**
* Displays the historical rooms list
*/
public class HistoricalRoomsActivity extends RiotAppCompatActivity implements
public class HistoricalRoomsActivity extends VectorAppCompatActivity implements
SearchView.OnQueryTextListener,
HomeRoomAdapter.OnSelectRoomListener,
AbsAdapter.MoreRoomActionListener,
Expand Down
Loading

0 comments on commit 5557a8c

Please sign in to comment.