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.30'
Browse files Browse the repository at this point in the history
  • Loading branch information
BillCarsonFr committed Oct 9, 2019
2 parents f3475f8 + 7ae9bd6 commit 7c10698
Show file tree
Hide file tree
Showing 19 changed files with 91 additions and 45 deletions.
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.30 (2019-10-09)
=======================================================

Bugfix:
- App won't start with some custom HS config #499

Translations:
- Updated translations


Changes to Matrix Android SDK in 0.9.29 (2019-10-04)
=======================================================

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.matrix.androidsdk.crypto.interfaces

interface CryptoDataHandler {
val store: CryptoStore
val store: CryptoStore?
fun setCryptoEventsListener(eventListener: CryptoEventListener)
fun getRoom(roomId: String): CryptoRoom
fun onEventDecrypted(event: CryptoEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ package org.matrix.androidsdk.crypto.interfaces

// For classical store
interface CryptoStore {
val eventStreamToken: String
val eventStreamToken: String?
}
4 changes: 2 additions & 2 deletions matrix-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 929
versionName "0.9.29"
versionCode 930
versionName "0.9.30"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

// Enable multi dex for test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ class PartialSharedSessionTest {
mTestHelper.await(latch)

val aliceRoom = aliceSession.dataHandler
.store
.getRoom(roomId)
.store!!.getRoom(roomId)


latch = CountDownLatch(1)
Expand Down Expand Up @@ -140,7 +139,7 @@ class PartialSharedSessionTest {

val aliceNewSession = mTestHelper.logIntoAccount(aliceSession.myUserId, defaultSessionParamsWithInitialSync)

val aliceRoomOtherSession = aliceNewSession.dataHandler.store.getRoom(aliceRoom.roomId)
val aliceRoomOtherSession = aliceNewSession.dataHandler.store!!.getRoom(aliceRoom.roomId)

val aliceSecondSessionEvents = sentEvents.map {
aliceRoomOtherSession.store.getEvent(it.eventId, aliceRoomOtherSession.roomId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ void checkPermanentStorageData() {
* @return the used store.
*/
@Override
@Nullable
public IMXStore getStore() {
if (isAlive()) {
return mStore;
Expand Down Expand Up @@ -1911,7 +1912,13 @@ public void onBingEvent(final Event event, final RoomState roomState, final Bing
public void updateEventState(Event event, Event.SentState newState) {
if ((null != event) && (event.mSentState != newState)) {
event.mSentState = newState;
getStore().flushRoomEvents(event.roomId);
//crash reported on app store
if (getStore() != null) {
getStore().flushRoomEvents(event.roomId);
} else {
Log.e(LOG_TAG, "#updateEventState Failed to access to store ");
}

onEventSentStateUpdated(event);
}
}
Expand Down
13 changes: 9 additions & 4 deletions matrix-sdk/src/main/java/org/matrix/androidsdk/MXSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,11 +289,16 @@ public void onStoreReady(String accountId) {

@Override
public void onStoreCorrupted(String accountId, String description) {
Log.d(LOG_TAG, "## onStoreCorrupted() : token " + getDataHandler().getStore().getEventStreamToken());
//NPE reported on store
if (getDataHandler().getStore() != null) {
Log.d(LOG_TAG, "## onStoreCorrupted() : token " + getDataHandler().getStore().getEventStreamToken());

// nothing was saved
if (null == getDataHandler().getStore().getEventStreamToken()) {
getDataHandler().onStoreReady();
// nothing was saved
if (null == getDataHandler().getStore().getEventStreamToken()) {
getDataHandler().onStoreReady();
}
} else {
Log.d(LOG_TAG, "## onStoreCorrupted() : no store access ");
}
}

Expand Down
25 changes: 15 additions & 10 deletions matrix-sdk/src/main/java/org/matrix/androidsdk/data/MyUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,20 @@ public void onSuccess(Void info) {
* Build the lists of identifiers
*/
private void buildIdentifiersLists() {
List<ThirdPartyIdentifier> identifiers = mDataHandler.getStore().thirdPartyIdentifiers();
mEmailIdentifiers = new ArrayList<>();
mPhoneNumberIdentifiers = new ArrayList<>();
for (ThirdPartyIdentifier identifier : identifiers) {
switch (identifier.medium) {
case ThreePid.MEDIUM_EMAIL:
mEmailIdentifiers.add(identifier);
break;
case ThreePid.MEDIUM_MSISDN:
mPhoneNumberIdentifiers.add(identifier);
break;
//NPE reported on playstore
if (mDataHandler.getStore() != null) {
List<ThirdPartyIdentifier> identifiers = mDataHandler.getStore().thirdPartyIdentifiers();
for (ThirdPartyIdentifier identifier : identifiers) {
switch (identifier.medium) {
case ThreePid.MEDIUM_EMAIL:
mEmailIdentifiers.add(identifier);
break;
case ThreePid.MEDIUM_MSISDN:
mPhoneNumberIdentifiers.add(identifier);
break;
}
}
}
}
Expand Down Expand Up @@ -311,7 +314,9 @@ public void onSuccess(String aDisplayname) {
// local value
displayname = aDisplayname;
// store metadata
mDataHandler.getStore().setDisplayName(aDisplayname, System.currentTimeMillis());
if (mDataHandler.getStore() != null) {
mDataHandler.getStore().setDisplayName(aDisplayname, System.currentTimeMillis());
}

mIsDisplayNameRefreshed = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class IdentityServerManager(val mxSession: MXSession,
if (accountDataElement.type == AccountDataElement.ACCOUNT_DATA_TYPE_IDENTITY_SERVER) {
// The identity server has been updated
val accountDataIdentityServer =
mxSession.dataHandler.store.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_IDENTITY_SERVER)
mxSession.dataHandler.store?.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_IDENTITY_SERVER)

accountDataIdentityServer?.content?.let {
localSetIdentityServerUrl(it[AccountDataElement.ACCOUNT_DATA_KEY_IDENTITY_SERVER_BASE_URL] as String?)
Expand Down Expand Up @@ -124,7 +124,7 @@ class IdentityServerManager(val mxSession: MXSession,
*/
private fun retrieveIdentityServerUrl(): String? {
val accountDataIdentityServer =
mxSession.dataHandler.store.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_IDENTITY_SERVER)
mxSession.dataHandler.store?.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_IDENTITY_SERVER)

accountDataIdentityServer?.content?.let {
return it[AccountDataElement.ACCOUNT_DATA_KEY_IDENTITY_SERVER_BASE_URL] as String?
Expand Down Expand Up @@ -270,12 +270,18 @@ class IdentityServerManager(val mxSession: MXSession,
identityAuthRestClient = null
thirdPidRestClient = null
} else {
val alteredHsConfig = HomeServerConnectionConfig.Builder(mxSession.homeServerConfig)
.withIdentityServerUri(Uri.parse(newUrl))
.build()
try {
val alteredHsConfig = HomeServerConnectionConfig.Builder(mxSession.homeServerConfig)
.withIdentityServerUri(Uri.parse(newUrl))
.build()

identityAuthRestClient = IdentityAuthRestClient(alteredHsConfig)
thirdPidRestClient = ThirdPidRestClient(alteredHsConfig)
identityAuthRestClient = IdentityAuthRestClient(alteredHsConfig)
thirdPidRestClient = ThirdPidRestClient(alteredHsConfig)
} catch (t: Throwable) {
Log.e(LOG_TAG, "Failed to create IS Rest clients", t)
//What to do from there? this IS is invalid
return
}
}

synchronized(listeners) { listeners.forEach { it.onIdentityServerChange() } }
Expand All @@ -302,6 +308,11 @@ class IdentityServerManager(val mxSession: MXSession,
}

private fun requestIdentityServerToken(requestOpenIdTokenResponse: RequestOpenIdTokenResponse, callback: ApiCallback<String>) {
if (identityAuthRestClient == null) {
callback.onUnexpectedError(IdentityServerNotConfiguredException())
return
}

identityAuthRestClient?.register(requestOpenIdTokenResponse, object : SimpleApiCallback<IdentityServerRegisterResponse>(callback) {
override fun onSuccess(info: IdentityServerRegisterResponse) {
// Store the token for next time
Expand Down Expand Up @@ -596,7 +607,7 @@ class IdentityServerManager(val mxSession: MXSession,
override fun onUnexpectedError(e: Exception) {
if (e is IdentityServerV2ApiNotAvailable) {
//mm ? request to HS?
legacyDeleteAndRequestToken(threePid,callback,idServer)
legacyDeleteAndRequestToken(threePid, callback, idServer)
} else {
super.onUnexpectedError(e)
}
Expand Down Expand Up @@ -659,7 +670,7 @@ class IdentityServerManager(val mxSession: MXSession,
override fun onUnexpectedError(e: Exception) {
if (e is IdentityServerV2ApiNotAvailable) {
//mm ? request to HS?
legacyDeleteAndAddMsisdn(threePid,callback,idServer)
legacyDeleteAndAddMsisdn(threePid, callback, idServer)
} else {
super.onUnexpectedError(e)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class TermsManager(private val mxSession: MXSession) {

private fun getAlreadyAcceptedTermUrlsFromAccountData(): Set<String> {
val accountDataCurrentAcceptedTerms =
mxSession.dataHandler.store.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_ACCEPTED_TERMS)
mxSession.dataHandler.store?.getAccountDataElement(AccountDataElement.ACCOUNT_DATA_TYPE_ACCEPTED_TERMS)

return (accountDataCurrentAcceptedTerms?.content
?.get(AccountDataElement.ACCOUNT_DATA_KEY_ACCEPTED_TERMS) as? List<*>)
Expand Down
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -175,4 +175,5 @@
<string name="initial_sync_start_importing_account_groups">Erste Synchronisation: Importiere Gemeinschaften</string>
<string name="initial_sync_start_importing_account_data">Erste Synchronisation: Importiere Benutzerdaten</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s hat die Einladung an %2$s, den Raum zu betreten, zurückgezogen</string>
</resources>
7 changes: 4 additions & 3 deletions matrix-sdk/src/main/res/values-fi/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<string name="notice_placed_voice_call">%s soitti äänipuhelun.</string>
<string name="notice_answered_call">%s vastasi puheluun.</string>
<string name="notice_ended_call">%s lopetti puhelun.</string>
<string name="notice_made_future_room_visibility">%1$s muutti tulevan huonehistorian näkyväksi käyttäjälle %2$s</string>
<string name="notice_made_future_room_visibility">%1$s muutti tulevan huonehistorian näkyväksi seuraaville: %2$s</string>
<string name="notice_room_visibility_invited">kaikki huoneen jäsenet, kutsumisestaan asti.</string>
<string name="notice_room_visibility_joined">kaikki huoneen jäsenet, liittymisestään asti.</string>
<string name="notice_room_visibility_shared">kaikki huoneen jäsenet.</string>
Expand All @@ -34,7 +34,7 @@
<string name="notice_voip_started">VoIP-konferenssi alkoi</string>
<string name="notice_voip_finished">VoIP-konferenssi päättyi</string>

<string name="notice_avatar_changed_too">(myös profiilikuva vaihdettiin)</string>
<string name="notice_avatar_changed_too">(myös kuva vaihdettiin)</string>
<string name="notice_room_name_removed">%1$s poisti huoneen nimen</string>
<string name="notice_room_topic_removed">%1$s poisti huoneen aiheen</string>
<string name="notice_profile_change_redacted">%1$s päivitti profiilinsa %2$s</string>
Expand Down Expand Up @@ -173,4 +173,5 @@
<string name="event_status_sending_message">Lähetetään viestiä…</string>
<string name="clear_timeline_send_queue">Tyhjennä lähetysjono</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s veti takaisin käyttäjän %2$s liittymiskutsun huoneeseen</string>
</resources>
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@
<string name="event_status_sending_message">Envoi du message…</string>
<string name="clear_timeline_send_queue">Vider la file d’envoi</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s a révoqué l’invitation pour %2$s à rejoindre le salon</string>
</resources>
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-hu/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,4 +171,5 @@
<string name="event_status_sending_message">Üzenet küldése…</string>
<string name="clear_timeline_send_queue">Küldő sor ürítése</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s visszavonta a meghívót a belépéshez ebbe a szobába: %2$s</string>
</resources>
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@
<string name="event_status_sending_message">Invio messaggio in corso …</string>
<string name="clear_timeline_send_queue">Cancella la coda di invio</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s ha revocato l\'invito a %2$s di unirsi alla stanza</string>
</resources>
5 changes: 3 additions & 2 deletions matrix-sdk/src/main/res/values-ko/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<string name="notice_crypto_unable_to_decrypt">** 암호를 해독할 수 없음: %s **</string>
<string name="notice_crypto_error_unkwown_inbound_session_id">발신인의 기기에서 이 메시지의 키를 보내지 않았습니다.</string>

<string name="message_reply_to_prefix">질문한 사람</string>
<string name="message_reply_to_prefix">관련 대화</string>

<string name="could_not_redact">검열할 수 없습니다</string>
<string name="unable_to_send_message">메시지를 보낼 수 없습니다</string>
Expand Down Expand Up @@ -170,4 +170,5 @@
<string name="event_status_sending_message">메시지 보내는 중…</string>
<string name="clear_timeline_send_queue">전송 대기 열 지우기</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s님이 %2$s님에게 방에 참가하라고 보낸 초대를 취소했습니다</string>
</resources>
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-nl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,5 @@
<string name="event_status_sending_message">Bericht wordt verstuurd…</string>
<string name="clear_timeline_send_queue">Uitgaande wachtrij legen</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s heeft de uitnodiging voor %2$s om het gesprek toe te treden ingetrokken</string>
</resources>
5 changes: 3 additions & 2 deletions matrix-sdk/src/main/res/values-vls/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<string name="notice_event_redacted_with_reason">Bericht verwyderd [reden: %1$s]</string>
<string name="notice_event_redacted_by_with_reason">Bericht verwyderd deur %1$s [reden: %2$s]</string>
<string name="notice_profile_change_redacted">%1$s èt zyn/heur profiel %2$s bygewerkt</string>
<string name="notice_room_third_party_invite">%1$s èt een uutnodigienge noa %2$s gesteurd vo ’t gesprek toe te treden</string>
<string name="notice_room_third_party_invite">%1$s èt een uutnodigienge noa %2$s gesteurd vo ’t gesprek toe te treedn</string>
<string name="notice_room_third_party_registered_invite">%1$s èt d’uutnodigienge vo %2$s anveird</string>

<string name="notice_crypto_unable_to_decrypt">** Kun nie ountsleuteln: %s **</string>
Expand Down Expand Up @@ -172,4 +172,5 @@
<string name="event_status_sending_message">Bericht wor verstuurd…</string>
<string name="clear_timeline_send_queue">Uutgoande wachtreeke leegn</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s èt d’uutnodigienge vo %2$s vo ’t gesprek toe te treedn ingetrokkn</string>
</resources>
3 changes: 2 additions & 1 deletion matrix-sdk/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@
<string name="event_status_sending_message">正在傳送訊息……</string>
<string name="clear_timeline_send_queue">清除傳送佇列</string>

</resources>
<string name="notice_room_third_party_revoked_invite">%1$s 撤銷了 %2$s 加入聊天室的邀請</string>
</resources>

0 comments on commit 7c10698

Please sign in to comment.