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 Jun 1, 2018
2 parents 3d797f2 + 6508a40 commit 661a385
Show file tree
Hide file tree
Showing 18 changed files with 166 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ cache:
- $HOME/.android/build-cache

# Just build the project for now
script: ./gradlew clean assembleRelease --stacktrace
script: ./gradlew clean lintRelease test assembleRelease --stacktrace
10 changes: 10 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
Changes to Matrix Android SDK in 0.9.5 (2018-06-01)
=======================================================

Bugfix
- Fix regression on URL preview, along with regression on searching user. (vector-im/riot-android#2264)
- Fix bad param format on reporting content request (vector-im/riot-android#2301)

API Change:
- New API in MXSession to deactivate account

Changes to Matrix Android SDK in 0.9.4 (2018-05-25)
=======================================================

Expand Down
33 changes: 19 additions & 14 deletions matrix-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ android {
minSdkVersion 16
targetSdkVersion 26
// use version to define a version code.
versionCode 904
version "0.9.4"
versionName "0.9.4"
versionCode 905
version "0.9.5"
versionName "0.9.5"
resValue "string", "flavor_description", "SDKApp"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Expand Down Expand Up @@ -103,6 +103,12 @@ android {
dir 'libs'
}
}

testOptions {
unitTests {
includeAndroidResources = true
}
}
}

static def gitRevision() {
Expand Down Expand Up @@ -135,21 +141,20 @@ dependencies {
// replace the compile 'io.pristine:libjingle:9690@aar'
implementation(name: 'react-native-webrtc', ext: 'aar')

// Robolectric
testImplementation 'com.android.support.test:runner:0.5'
testImplementation 'com.android.support.test:rules:0.5'
testImplementation 'org.mockito:mockito-core:1.+'
// Test
testImplementation 'com.android.support.test:runner:1.0.2'
testImplementation 'com.android.support.test:rules:1.0.2'
testImplementation 'org.mockito:mockito-core:2.7.22'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest-library:1.3'
testImplementation 'org.apache.maven:maven-ant-tasks:2.1.3' // fixes issue on linux/mac
testImplementation('org.robolectric:robolectric:3.0') {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}

// Robolectric
testImplementation "org.robolectric:robolectric:3.8"

testImplementation 'junit:junit:4.12'
androidTestImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support:support-annotations:25.3.1'
androidTestImplementation 'com.android.support.test:runner:0.5'
androidTestImplementation 'com.android.support.test:rules:0.5'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
}
37 changes: 37 additions & 0 deletions matrix-sdk/src/main/java/org/matrix/androidsdk/MXSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,43 @@ public void onUnexpectedError(Exception e) {
});
}

/**
* Deactivate the account.
*
* @param context the application context
* @param type type of authentication
* @param userPassword current password
* @param eraseUserData true to also erase all the user data
* @param callback the success and failure callback
*/
public void deactivateAccount(final Context context,
final String type,
final String userPassword,
final boolean eraseUserData,
final ApiCallback<Void> callback) {
mProfileRestClient.deactivateAccount(type, getMyUserId(), userPassword, eraseUserData, new SimpleApiCallback<Void>(callback) {

@Override
public void onSuccess(Void info) {
Log.e(LOG_TAG, "## deactivateAccount() : succeed -> clearing the application data ");

// Clear crypto data
// For security and because it will be no more useful as we will get a new device id
// on the next log in
enableCrypto(false, null);

clear(context, new SimpleApiCallback<Void>(callback) {
@Override
public void onSuccess(Void info) {
if (null != callback) {
callback.onSuccess(null);
}
}
});
}
});
}

/**
* Update the URL preview status by default
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import java.util.Map;

import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
Expand Down Expand Up @@ -78,7 +77,7 @@ public interface EventsApi {
*
* @param searchUsersParams the search params.
*/
@POST(RestClient.URI_API_PREFIX_PATH_R0 + "/user_directory/search")
@POST(RestClient.URI_API_PREFIX_PATH_R0 + "user_directory/search")
Call<SearchUsersRequestResponse> searchUsers(@Body SearchUsersParams searchUsersParams);

/**
Expand All @@ -87,6 +86,6 @@ public interface EventsApi {
* @param url the URL
* @param ts the ts
*/
@GET(RestClient.URI_API_PREFIX_PATH_MEDIA_R0 + "/preview_url")
@GET(RestClient.URI_API_PREFIX_PATH_MEDIA_R0 + "preview_url")
Call<Map<String, Object>> getURLPreview(@Query("url") String url, @Query("ts") long ts);
}
Original file line number Diff line number Diff line change
Expand Up @@ -646,17 +646,14 @@ public void onRetry() {
* @param eventId the event id
* @param score the metric to let the user rate the severity of the abuse. It ranges from -100 “most offensive” to 0 “inoffensive”
* @param reason the reason
* @param callback the callback containing the created event if successful
* @param callback the callback
*/
public void reportEvent(final String roomId, final String eventId, final int score, final String reason, final ApiCallback<Void> callback) {
final String description = "report : roomId " + roomId + " eventId " + eventId;

ReportContentParams content = new ReportContentParams();

ArrayList<Integer> scores = new ArrayList<>();
scores.add(score);

content.score = scores;
content.score = score;
content.reason = reason;

mApi.reportEvent(roomId, eventId, content).enqueue(new RestAdapterCallback<Void>(description, mUnsentEventsManager, callback, new RestAdapterCallback.RequestRetryCallBack() {
Expand Down Expand Up @@ -985,4 +982,4 @@ public void onRetry() {
}
}));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class ReportContentParams {

// The event range from -100 “most offensive” to 0 “inoffensive”.
public List<Integer> score;
public int score;

// the report reason
public String reason;
Expand Down
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-bg/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s изпрати стикер.</string>

<string name="message_reply_to_prefix">В отговор на</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@

<string name="summary_user_sent_sticker">%1$s sandte einen Sticker.</string>

<string name="message_reply_to_prefix">Als Antwort auf</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-eu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s erabiltzaileak eranskailu bat bidali du.</string>

<string name="message_reply_to_prefix">Honi erantzunez</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s a envoyé un sticker.</string>

<string name="message_reply_to_prefix">En réponse à</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s küldött egy matricát.</string>

<string name="message_reply_to_prefix">Válasz erre:</string>

</resources>
70 changes: 70 additions & 0 deletions matrix-sdk/src/main/res/values-is/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version='1.0' encoding='UTF-8'?>
<resources><string name="matrix_sdk_app_name">Matrix Android SDK</string>

<string name="summary_message">%1$s: %2$s</string>
<string name="summary_user_sent_image">%1$s sendi mynd.</string>
<string name="summary_user_sent_sticker">%1$s sendi límmerki.</string>

<string name="notice_room_invite_no_invitee">%s sendi boð um þátttöku</string>
<string name="notice_room_invite">%1$s bauð %2$s</string>
<string name="notice_room_invite_you">%1$s bauð þér</string>
<string name="notice_room_join">%1$s gekk í hópinn</string>
<string name="notice_room_leave">%1$s hætti</string>
<string name="notice_room_reject">%1$s hafnaði boðinu</string>
<string name="notice_room_kick">%1$s sparkaði %2$s</string>
<string name="notice_room_unban">%1$s afbannaði %2$s</string>
<string name="notice_room_ban">%1$s bannaði %2$s</string>
<string name="notice_avatar_url_changed">%1$s breyttu auðkennismynd sinni</string>
<string name="notice_room_visibility_invited">allir meðlimir spjallrásar, síðan þeim var boðið.</string>
<string name="notice_room_visibility_joined">allir meðlimir spjallrásar, síðan þeir skráðu sig.</string>
<string name="notice_room_visibility_shared">allir meðlimir spjallrásar.</string>
<string name="notice_room_visibility_world_readable">hver sem er.</string>
<string name="notice_room_visibility_unknown">óþekktur (%s).</string>
<string name="notice_voip_started">VoIP-símafundur hafinn</string>
<string name="notice_voip_finished">VoIP-símafundi lokið</string>

<string name="notice_avatar_changed_too">(einnig var skipt um auðkennismynd)</string>
<string name="notice_event_redacted_by">" af %1$s"</string>
<string name="notice_event_redacted_reason">" [ástæða: %1$s]"</string>
<string name="notice_crypto_unable_to_decrypt">** Mistókst að afkóða: %s **</string>
<string name="message_reply_to_prefix">Sem svar til</string>

<string name="unable_to_send_message">Gat ekki sent skilaboð</string>

<string name="message_failed_to_upload">Gat ekki sent inn mynd</string>

<string name="network_error">Villa í netkerfi</string>
<string name="matrix_error">Villa í Matrix</string>

<string name="encrypted_message">Dulrituð skilaboð</string>

<string name="medium_email">Tölvupóstfang</string>
<string name="medium_phone_number">Símanúmer</string>

<string name="notice_room_withdraw">%1$s tók til baka boð frá %2$s</string>
<string name="notice_display_name_set">%1$s setti birtingarnafn sitt sem %2$s</string>
<string name="notice_display_name_changed_from">%1$s breytti birtingarnafni sínu úr %2$s í %3$s</string>
<string name="notice_display_name_removed">%1$s fjarlægði birtingarnafn sitt (%2$s)</string>
<string name="notice_topic_changed">%1$s breytti umræðuefninu í: %2$s</string>
<string name="notice_room_name_changed">%1$s breytti heiti spjallrásarinnar í: %2$s</string>
<string name="notice_placed_video_call">%s hringdi myndsamtal.</string>
<string name="notice_placed_voice_call">%s hringdi raddsamtal.</string>
<string name="notice_answered_call">%s svaraði símtalinu.</string>
<string name="notice_ended_call">%s lauk símtalinu.</string>
<string name="notice_end_to_end">%1$s kveikti á enda-í-enda dulritun (%2$s)</string>

<string name="notice_requested_voip_conference">%1$s bað um VoIP-símafund</string>
<string name="notice_room_name_removed">%1$s fjarlægði heiti spjallrásar</string>
<string name="notice_room_topic_removed">%1$s fjarlægði umfjöllunarefni spjallrásar</string>
<string name="notice_made_future_room_visibility">%1$s gerði ferilskrá spjallrásar héðan í frá sýnilega fyrir %2$s</string>
<string name="notice_event_redacted">"ritstýrði %1$s "</string>
<string name="notice_profile_change_redacted">%1$s uppfærði notandasniðið sitt %2$s</string>
<string name="notice_room_third_party_invite">%1$s sendi boð til %2$s um þátttöku í spjallrásinni</string>
<string name="notice_room_third_party_registered_invite">%1$s samþykkti boð um að taka þátt í %2$s</string>

<string name="notice_crypto_error_unkwown_inbound_session_id">Tæki sendandans hefur ekki sent okkur dulritunarlyklana fyrir þessi skilaboð.</string>

<string name="could_not_redact">Gat ekki ritstýrt</string>
<string name="room_error_join_failed_empty_room">Ekki er í augnablikinu hægt að taka aftur þátt í spjallrás sem er tóm.</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@
<string name="notice_event_redacted">"corretto %1$s "</string>
<string name="summary_user_sent_sticker">%1$s ha inviato un adesivo.</string>

<string name="message_reply_to_prefix">In risposta a</string>

</resources>
6 changes: 5 additions & 1 deletion matrix-sdk/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@
<string name="medium_email">E-mailadres</string>
<string name="medium_phone_number">Telefoonnummer</string>

</resources>
<string name="summary_user_sent_sticker">%1$s heeft een sticker gestuurd.</string>

<string name="message_reply_to_prefix">Als antwoord op</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,6 @@

<string name="summary_user_sent_sticker">%1$s отправил стикер.</string>

<string name="message_reply_to_prefix">В ответ на</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-sk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s poslal nálepku.</string>

<string name="message_reply_to_prefix">Odpoveď na</string>

</resources>
2 changes: 2 additions & 0 deletions matrix-sdk/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,6 @@

<string name="summary_user_sent_sticker">%1$s 傳送了一張貼圖。</string>

<string name="message_reply_to_prefix">回覆</string>

</resources>

0 comments on commit 661a385

Please sign in to comment.