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-v0.8.1'
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGES.rst
#	build.gradle
#	build_fdroid_apk.sh
#	build_jitsi_libs.sh
#	build_olm_lib.sh
#	vector/build.gradle
#	vector/libs/matrix-sdk.aar
#	vector/libs/react-native-locale-detector.aar
#	vector/src/main/java/im/vector/widgets/Widget.java
  • Loading branch information
giomfo committed Feb 15, 2018
2 parents 863f4d1 + f344dc9 commit f8cea1c
Show file tree
Hide file tree
Showing 204 changed files with 12,618 additions and 2,284 deletions.
36 changes: 36 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
Changes in Riot 0.8.1 (2018-02-15)
===================================================

Improvements:
* Update matrix-sdk.aar lib (v0.9.0).

Bug Fix:
* URL Preview: We should have it for m.notice too (PR 1975).

Changes in Riot 0.8.00-beta (2018-02-02)
===================================================

Features:

* Add a new tab to list the user's communities (vector-im/riot-meta/#114).
* Add new screens to display the community details, edition is not supported yet (vector-im/riot-meta/#115, vector-im/riot-meta/#116, vector-im/riot-meta/#117).
* Room Settings: handle the related communities in order to show flair for them.
* User Settings: Let the user enable his community flair in rooms configured to show it.
* Add the url preview feature (PR #1929).

Improvements:

* Support the 4 states for the room notification level (all messages (noisy), all messages, mention only, mute).
* Add the avatar to the pills displayed in room history (PR #1917).
* Set the push server URLs as a resource string (PR #1908).
* Improve duplicate events detection (#1907).
* Vibrate when long pressing on an user name / avatar to copy his/her name in the edit text.
* Improve the notifications management.

Bugfixes:

* #1903: Weird room layout.
* #1896: Copy source code of a message.
* #1821, #1850: Improve the text sharing.
* #1920: Phone vibrates when mentioning someone.

Changes in Riot 0.7.09 (2018-01-16)
===================================================

Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ Customise your flavour

You will need to manage your own provider because "im.vector" is already used (look at VectorContentProvider to manage it).

Customise your application settings with a custom google play link
===================================================================

It is possible to set some default values to Riot with some extra parameters to the google play link.

- Use the https://developers.google.com/analytics/devguides/collection/android/v4/campaigns URL generator (at the bottom)

Set "Campaign Source"
Set "Campaign Content" with the extra parameters (e.g. is=http://my__is.org&hs=http://my_hs.org)
Generate the customised link

- Supported extra parameters
is : identidy server URL
hs : home server URL

FAQ
===

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

// global properties used in sub modules
ext {
versionCodeProp = 70900
versionNameProp = "0.7.09"
versionCodeProp = 80001
versionNameProp = "0.8.1"
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
buildNumberProp = "${versionBuild}"
}
Expand Down
17 changes: 17 additions & 0 deletions set_debug_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
echo remove the SDK lib
rm -f vector/libs/matrix-sdk.aar
rm -rf vector/build

echo remove sdk folder
rm -rf ../matrix-android-sdk

echo clone the git folder
git clone -b develop https://github.com/matrix-org/matrix-android-sdk ../matrix-android-sdk

echo replace step 1
sed -i '' -e 's/\/\/include/include/' settings.gradle || true
sed -i '' -e 's/\/\/project/project/' settings.gradle || true

echo replace step 2
sed -i '' -e "s/compile(name: 'matrix/\/\/compile(name: 'matrix/" vector/build.gradle || true
sed -i '' -e "s/\/\/compile project(':matrix-/compile project(':matrix-/" vector/build.gradle || true
2 changes: 2 additions & 0 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ android {
disable 'InvalidPackage'
disable 'MissingTranslation'
disable 'RestrictedApi'
disable 'ImpliedQuantity'
}

repositories {
Expand Down Expand Up @@ -189,6 +190,7 @@ dependencies {
compile(name: 'react-native', ext: 'aar')
compile(name: 'react-native-locale-detector', ext: 'aar')


// another tracking than GA
compile 'org.piwik.sdk:piwik-sdk:2.0.0'

Expand Down
Binary file modified vector/libs/matrix-sdk.aar
Binary file not shown.
26 changes: 7 additions & 19 deletions vector/src/app/java/im/vector/gcm/MatrixGcmListenerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import im.vector.VectorApp;
import im.vector.activity.CommonActivityUtils;
import im.vector.services.EventStreamService;
import im.vector.util.PreferencesManager;

/**
* Class implementing GcmListenerService.
Expand Down Expand Up @@ -65,7 +64,10 @@ private Event parseEvent(Map<String, String> data) {
event.sender = data.get("sender");
event.roomId = data.get("room_id");
event.setType(data.get("type"));
event.updateContent((new JsonParser()).parse(data.get("content")).getAsJsonObject());

if (data.containsKey("content")) {
event.updateContent((new JsonParser()).parse(data.get("content")).getAsJsonObject());
}

return event;
} catch (Exception e) {
Expand Down Expand Up @@ -112,27 +114,13 @@ private void onMessageReceivedInternal(final Map<String, String> data) {
Log.d(LOG_TAG, "## onMessageReceivedInternal() : the notifications are disabled");
return;
}

boolean useBatteryOptim = !PreferencesManager.canStartBackgroundService(getApplicationContext()) && EventStreamService.isStopped();

if ((!gcmManager.isBackgroundSyncAllowed() || useBatteryOptim)
&& VectorApp.isAppInBackground()) {

if (!gcmManager.isBackgroundSyncAllowed() && VectorApp.isAppInBackground()) {
EventStreamService eventStreamService = EventStreamService.getInstance();
Event event = parseEvent(data);

if (!gcmManager.isBackgroundSyncAllowed()) {
Log.d(LOG_TAG, "## onMessageReceivedInternal() : the background sync is disabled with eventStreamService " + eventStreamService);
} else {
Log.d(LOG_TAG, "## onMessageReceivedInternal() : use the battery optimisation with eventStreamService " + eventStreamService);
}

if (null != eventStreamService) {
eventStreamService.onNotifiedEventWithBackgroundSyncDisabled(event, data.get("room_name"), data.get("sender_display_name"), unreadCount);
} else {
EventStreamService.onStaticNotifiedEvent(getApplicationContext(), event, data.get("room_name"), data.get("sender_display_name"), unreadCount);
}
Log.d(LOG_TAG, "## onMessageReceivedInternal() : the background sync is disabled with eventStreamService " + eventStreamService);

EventStreamService.onStaticNotifiedEvent(getApplicationContext(), event, data.get("room_name"), data.get("sender_display_name"), unreadCount);
return;
}

Expand Down
9 changes: 9 additions & 0 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,15 @@
android:label="@string/title_activity_bug_report"
android:windowSoftInputMode="stateHidden|adjustResize" />

<activity
android:name="im.vector.activity.VectorGroupDetailsActivity"
android:configChanges="orientation|screenSize"
android:label="@string/title_activity_group_details"
android:launchMode="singleTop"
android:theme="@style/GroupAppTheme"
android:windowSoftInputMode="adjustResize">
</activity>

<activity android:name=".activity.VectorUniversalLinkActivity">

<intent-filter>
Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/java/im/vector/KeyRequestHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ private void displayKeyShareDialog(final MXSession session, final MXDeviceInfo d

// set dialog message
alertDialogBuilder
.setCancelable(true)
.setCancelable(false)
.setNegativeButton(R.string.ignore_request, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
Expand Down
4 changes: 2 additions & 2 deletions vector/src/main/java/im/vector/LoginHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.matrix.androidsdk.rest.client.LoginRestClient;
import org.matrix.androidsdk.rest.client.ThirdPidRestClient;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.rest.model.ThreePid;
import org.matrix.androidsdk.rest.model.login.Credentials;
import org.matrix.androidsdk.rest.model.login.LoginFlow;
import org.matrix.androidsdk.rest.model.login.RegistrationParams;
import org.matrix.androidsdk.rest.model.pid.ThreePid;
import org.matrix.androidsdk.ssl.CertUtil;
import org.matrix.androidsdk.ssl.Fingerprint;
import org.matrix.androidsdk.ssl.UnrecognizedCertificateException;
Expand Down Expand Up @@ -157,7 +157,7 @@ private void callLogin(final Context ctx, final HomeServerConnectionConfig hsCon
if (!TextUtils.isEmpty(username)) {
if (android.util.Patterns.EMAIL_ADDRESS.matcher(username).matches()) {
// Login with 3pid
client.loginWith3Pid(ThreePid.MEDIUM_EMAIL, username.toLowerCase(), password, deviceName, callback);
client.loginWith3Pid(ThreePid.MEDIUM_EMAIL, username.toLowerCase(VectorApp.getApplicationLocale()), password, deviceName, callback);
} else {
// Login with user
client.loginWithUser(username, password, deviceName, callback);
Expand Down
15 changes: 10 additions & 5 deletions vector/src/main/java/im/vector/Matrix.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.matrix.androidsdk.crypto.MXCrypto;
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.ssl.Fingerprint;
import org.matrix.androidsdk.ssl.UnrecognizedCertificateException;
import org.matrix.androidsdk.util.BingRulesManager;
Expand All @@ -49,7 +50,6 @@

import im.vector.activity.CommonActivityUtils;
import im.vector.activity.SplashActivity;
import im.vector.activity.VectorHomeActivity;
import im.vector.gcm.GcmRegistrationManager;
import im.vector.services.EventStreamService;
import im.vector.store.LoginStorage;
Expand Down Expand Up @@ -592,11 +592,16 @@ private MXSession createSession(final Context context, HomeServerConnectionConfi
final MXSession session = new MXSession(hsConfig, new MXDataHandler(store, credentials), mAppContext);

session.getDataHandler().setRequestNetworkErrorListener(new MXDataHandler.RequestNetworkErrorListener() {

@Override
public void onTokenCorrupted() {
if (null != VectorApp.getCurrentActivity()) {
Log.e(LOG_TAG, "## createSession() : onTokenCorrupted");
CommonActivityUtils.logout(VectorApp.getCurrentActivity());
public void onConfigurationError(String matrixErrorCode) {
Log.e(LOG_TAG, "## createSession() : onConfigurationError " + matrixErrorCode);

if (TextUtils.equals(matrixErrorCode, MatrixError.UNKNOWN_TOKEN)) {
if (null != VectorApp.getCurrentActivity()) {
Log.e(LOG_TAG, "## createSession() : onTokenCorrupted");
CommonActivityUtils.logout(VectorApp.getCurrentActivity());
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions vector/src/main/java/im/vector/PublicRoomsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.matrix.androidsdk.rest.callback.ApiCallback;
import org.matrix.androidsdk.rest.callback.SimpleApiCallback;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.rest.model.PublicRoom;
import org.matrix.androidsdk.rest.model.PublicRoomsResponse;
import org.matrix.androidsdk.rest.model.publicroom.PublicRoom;
import org.matrix.androidsdk.rest.model.publicroom.PublicRoomsResponse;

import java.util.ArrayList;
import java.util.List;
Expand Down
2 changes: 1 addition & 1 deletion vector/src/main/java/im/vector/RegistrationManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.matrix.androidsdk.rest.client.ProfileRestClient;
import org.matrix.androidsdk.rest.client.ThirdPidRestClient;
import org.matrix.androidsdk.rest.model.MatrixError;
import org.matrix.androidsdk.rest.model.ThreePid;
import org.matrix.androidsdk.rest.model.pid.ThreePid;
import org.matrix.androidsdk.rest.model.login.Credentials;
import org.matrix.androidsdk.rest.model.login.LoginFlow;
import org.matrix.androidsdk.rest.model.login.RegistrationFlowResponse;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static void show(final HomeServerConnectionConfig hsConfig, final Fingerp

TextView sslFingerprintTitle = layout.findViewById(R.id.ssl_fingerprint_title);
sslFingerprintTitle.setText(
String.format(activity.getString(R.string.ssl_fingerprint_hash), unrecognizedFingerprint.getType().toString())
String.format(VectorApp.getApplicationLocale(), activity.getString(R.string.ssl_fingerprint_hash), unrecognizedFingerprint.getType().toString())
);

TextView sslFingerprint = layout.findViewById(R.id.ssl_fingerprint);
Expand Down
12 changes: 5 additions & 7 deletions vector/src/main/java/im/vector/VectorApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
import org.piwik.sdk.extra.TrackHelper;

import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -79,7 +77,6 @@
import im.vector.contacts.PIDsRetriever;
import im.vector.gcm.GcmRegistrationManager;
import im.vector.services.EventStreamService;
import im.vector.util.BugReporter;
import im.vector.util.CallsManager;
import im.vector.util.PhoneNumberUtils;
import im.vector.util.PreferencesManager;
Expand All @@ -104,7 +101,7 @@ public class VectorApp extends MultiDexApplication {
/**
* Rage shake detection to send a bug report.
*/
private static final RageShake mRageShake = new RageShake();
private RageShake mRageShake;

/**
* Delay to detect if the application is in background.
Expand Down Expand Up @@ -221,8 +218,6 @@ public void onCreate() {
} catch (Exception e) {
}



mLogsDirectoryFile = new File(getCacheDir().getAbsolutePath() + "/logs");

org.matrix.androidsdk.util.Log.setLogDirectory(mLogsDirectoryFile);
Expand All @@ -239,7 +234,7 @@ public void onCreate() {
Log.d(LOG_TAG, "----------------------------------------------------------------");
Log.d(LOG_TAG, "----------------------------------------------------------------\n\n\n\n");

mRageShake.start(this);
mRageShake = new RageShake(this);

// init the REST client
MXSession.initUserAgent(getApplicationContext());
Expand Down Expand Up @@ -414,6 +409,8 @@ private void suspendApp() {

MyPresenceManager.advertiseAllUnavailable();

mRageShake.stop();

onAppPause();
}

Expand Down Expand Up @@ -544,6 +541,7 @@ private void stopActivityTransitionTimer() {
}

MyPresenceManager.advertiseAllOnline();
mRageShake.start();

mIsCallingInBackground = false;
mIsInBackground = false;
Expand Down
Loading

0 comments on commit f8cea1c

Please sign in to comment.