From 077396a8326a373302aa1eeacd363d4c833262b7 Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 17 Jul 2019 16:20:12 +0200 Subject: [PATCH 01/19] E2E replies + Edit History / support e2e and use original event --- .../model/event/EncryptedEventContent.kt | 6 ++- .../room/EventRelationsAggregationTask.kt | 44 ++++++++++++++++--- .../session/room/prune/PruneEventTask.kt | 27 +++++++----- .../room/relation/DefaultRelationService.kt | 30 ++++++++++--- .../room/relation/FetchEditHistoryTask.kt | 10 ++++- .../room/relation/RelationsResponse.kt | 1 + .../timeline/action/MessageMenuViewModel.kt | 2 +- .../action/ViewEditHistoryEpoxyController.kt | 4 +- .../action/ViewEditHistoryViewModel.kt | 35 ++++++++++++--- .../timeline/factory/MessageItemFactory.kt | 9 +++- 10 files changed, 129 insertions(+), 39 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/event/EncryptedEventContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/event/EncryptedEventContent.kt index 108ce056eb..4d06b737e8 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/event/EncryptedEventContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/event/EncryptedEventContent.kt @@ -17,6 +17,7 @@ package im.vector.matrix.android.internal.crypto.model.event import com.squareup.moshi.Json import com.squareup.moshi.JsonClass +import im.vector.matrix.android.api.session.room.model.relation.RelationDefaultContent /** * Class representing an encrypted event content @@ -52,5 +53,8 @@ data class EncryptedEventContent( * The session id */ @Json(name = "session_id") - val sessionId: String? = null + val sessionId: String? = null, + + //Relation context is in clear in encrypted message + @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? = null ) \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt index b55a7e14c9..f8c1024d2a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt @@ -17,9 +17,13 @@ package im.vector.matrix.android.internal.session.room import arrow.core.Try import com.zhuinden.monarchy.Monarchy +import im.vector.matrix.android.api.session.crypto.CryptoService +import im.vector.matrix.android.api.session.crypto.MXCryptoError import im.vector.matrix.android.api.session.events.model.* import im.vector.matrix.android.api.session.room.model.message.MessageContent import im.vector.matrix.android.api.session.room.model.relation.ReactionContent +import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult +import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent import im.vector.matrix.android.internal.database.mapper.ContentMapper import im.vector.matrix.android.internal.database.mapper.EventMapper import im.vector.matrix.android.internal.database.model.* @@ -43,7 +47,9 @@ internal interface EventRelationsAggregationTask : Task + EventAnnotationsSummaryEntity.where(realm, event.eventId + ?: "").findFirst()?.let { + TimelineEventEntity.where(realm, eventId = event.eventId + ?: "").findFirst()?.let { tet -> tet.annotations = it } } } + + EventType.ENCRYPTED -> { + //Relation type is in clear + val encryptedEventContent = event.content.toModel() + if (encryptedEventContent?.relatesTo?.type == RelationType.REPLACE) { + //we need to decrypt if needed + if (event.mxDecryptionResult == null) { + try { + val result = cryptoService.decryptEvent(event, event.roomId) + event.mxDecryptionResult = OlmDecryptionResult( + payload = result.clearEvent, + senderKey = result.senderCurve25519Key, + keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) }, + forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain + ) + } catch (e: MXCryptoError) { + + } + } + event.getClearContent().toModel()?.let { + Timber.v("###REPLACE in room $roomId for event ${event.eventId}") + //A replace! + handleReplace(realm, event, it, roomId, isLocalEcho, encryptedEventContent.relatesTo.eventId) + } + } + } EventType.REDACTION -> { val eventToPrune = event.redacts?.let { EventEntity.where(realm, eventId = it).findFirst() } ?: return@forEach @@ -125,9 +159,9 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor(private } - private fun handleReplace(realm: Realm, event: Event, content: MessageContent, roomId: String, isLocalEcho: Boolean) { + private fun handleReplace(realm: Realm, event: Event, content: MessageContent, roomId: String, isLocalEcho: Boolean, relatedEventId: String? = null) { val eventId = event.eventId ?: return - val targetEventId = content.relatesTo?.eventId ?: return + val targetEventId = relatedEventId ?: content.relatesTo?.eventId ?: return val newContent = content.newContent ?: return //ok, this is a replace var existing = EventAnnotationsSummaryEntity.where(realm, targetEventId).findFirst() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/prune/PruneEventTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/prune/PruneEventTask.kt index 8ea8c3370d..24dc14a72f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/prune/PruneEventTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/prune/PruneEventTask.kt @@ -61,13 +61,13 @@ internal class DefaultPruneEventTask @Inject constructor(private val monarchy: M } val redactionEventEntity = EventEntity.where(realm, eventId = redactionEvent.eventId - ?: "").findFirst() - ?: return + ?: "").findFirst() + ?: return val isLocalEcho = redactionEventEntity.sendState == SendState.UNSENT Timber.v("Redact event for ${redactionEvent.redacts} localEcho=$isLocalEcho") val eventToPrune = EventEntity.where(realm, eventId = redactionEvent.redacts).findFirst() - ?: return + ?: return val allowedKeys = computeAllowedKeys(eventToPrune.type) if (allowedKeys.isNotEmpty()) { @@ -75,10 +75,11 @@ internal class DefaultPruneEventTask @Inject constructor(private val monarchy: M eventToPrune.content = ContentMapper.map(prunedContent) } else { when (eventToPrune.type) { + EventType.ENCRYPTED, EventType.MESSAGE -> { Timber.d("REDACTION for message ${eventToPrune.eventId}") val unsignedData = EventMapper.map(eventToPrune).unsignedData - ?: UnsignedData(null, null) + ?: UnsignedData(null, null) //was this event a m.replace // val contentModel = ContentMapper.map(eventToPrune.content)?.toModel() @@ -89,6 +90,8 @@ internal class DefaultPruneEventTask @Inject constructor(private val monarchy: M val modified = unsignedData.copy(redactedEvent = redactionEvent) eventToPrune.content = ContentMapper.map(emptyMap()) eventToPrune.unsignedData = MoshiProvider.providesMoshi().adapter(UnsignedData::class.java).toJson(modified) + eventToPrune.decryptionResultJson = null + eventToPrune.decryptionErrorCode = null } // EventType.REACTION -> { @@ -112,14 +115,14 @@ internal class DefaultPruneEventTask @Inject constructor(private val monarchy: M EventType.STATE_ROOM_CREATE -> listOf("creator") EventType.STATE_ROOM_JOIN_RULES -> listOf("join_rule") EventType.STATE_ROOM_POWER_LEVELS -> listOf("users", - "users_default", - "events", - "events_default", - "state_default", - "ban", - "kick", - "redact", - "invite") + "users_default", + "events", + "events_default", + "state_default", + "ban", + "kick", + "redact", + "invite") EventType.STATE_ROOM_ALIASES -> listOf("aliases") EventType.STATE_CANONICAL_ALIAS -> listOf("alias") EventType.FEEDBACK -> listOf("type", "target_event_id") diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt index 37a7f09420..025de46279 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt @@ -127,9 +127,17 @@ internal class DefaultRelationService @Inject constructor(private val context: C .also { saveLocalEcho(it) } - val workRequest = createSendEventWork(event) - TimelineSendEventWorkCommon.postWork(context, roomId, workRequest) - return CancelableWork(context, workRequest.id) + if (cryptoService.isRoomEncrypted(roomId)) { + val encryptWork = createEncryptEventWork(event, listOf("m.relates_to")) + val workRequest = createSendEventWork(event) + TimelineSendEventWorkCommon.postSequentialWorks(context, roomId, encryptWork, workRequest) + return CancelableWork(context, encryptWork.id) + + } else { + val workRequest = createSendEventWork(event) + TimelineSendEventWorkCommon.postWork(context, roomId, workRequest) + return CancelableWork(context, workRequest.id) + } } @@ -146,13 +154,21 @@ internal class DefaultRelationService @Inject constructor(private val context: C .also { saveLocalEcho(it) } - val workRequest = createSendEventWork(event) - TimelineSendEventWorkCommon.postWork(context, roomId, workRequest) - return CancelableWork(context, workRequest.id) + if (cryptoService.isRoomEncrypted(roomId)) { + val encryptWork = createEncryptEventWork(event, listOf("m.relates_to")) + val workRequest = createSendEventWork(event) + TimelineSendEventWorkCommon.postSequentialWorks(context, roomId, encryptWork, workRequest) + return CancelableWork(context, encryptWork.id) + + } else { + val workRequest = createSendEventWork(event) + TimelineSendEventWorkCommon.postWork(context, roomId, workRequest) + return CancelableWork(context, workRequest.id) + } } override fun fetchEditHistory(eventId: String, callback: MatrixCallback>) { - val params = FetchEditHistoryTask.Params(roomId, eventId) + val params = FetchEditHistoryTask.Params(roomId, cryptoService.isRoomEncrypted(roomId), eventId) fetchEditHistoryTask.configureWith(params) .dispatchTo(callback) .executeBy(taskExecutor) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/FetchEditHistoryTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/FetchEditHistoryTask.kt index e891ece8da..7afbe2884b 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/FetchEditHistoryTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/FetchEditHistoryTask.kt @@ -29,6 +29,7 @@ internal interface FetchEditHistoryTask : Task> { return executeRequest { - apiCall = roomAPI.getRelations(params.roomId, params.eventId, RelationType.REPLACE, EventType.MESSAGE) + apiCall = roomAPI.getRelations(params.roomId, + params.eventId, + RelationType.REPLACE, + if (params.isRoomEncrypted) EventType.ENCRYPTED else EventType.MESSAGE) }.map { resp -> - resp.chunks + val events = resp.chunks.toMutableList() + resp.originalEvent?.let { events.add(it) } + events } } } \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/RelationsResponse.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/RelationsResponse.kt index 5d39e81c48..737165ff0f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/RelationsResponse.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/RelationsResponse.kt @@ -22,6 +22,7 @@ import im.vector.matrix.android.api.session.events.model.Event @JsonClass(generateAdapter = true) internal data class RelationsResponse( @Json(name = "chunk") val chunks: List, + @Json(name = "original_event") val originalEvent: Event?, @Json(name = "next_batch") val nextBatch: String?, @Json(name = "prev_batch") val prevBatch: String? ) \ No newline at end of file diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageMenuViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageMenuViewModel.kt index 54ff30774d..5b0dbdfed2 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageMenuViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/MessageMenuViewModel.kt @@ -244,7 +244,7 @@ class MessageMenuViewModel @AssistedInject constructor(@Assisted initialState: M //Only event of type Event.EVENT_TYPE_MESSAGE are supported for the moment if (event.root.getClearType() != EventType.MESSAGE) return false //TODO if user is admin or moderator - val messageContent = event.root.content.toModel() + val messageContent = event.root.getClearContent().toModel() return event.root.senderId == myUserId && ( messageContent?.type == MessageType.MSGTYPE_TEXT || messageContent?.type == MessageType.MSGTYPE_EMOTE diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryEpoxyController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryEpoxyController.kt index 34e340731f..fc11f25561 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryEpoxyController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryEpoxyController.kt @@ -75,9 +75,7 @@ class ViewEditHistoryEpoxyController(private val context: Context, } } else { var lastDate: Calendar? = null - sourceEvents.sortedByDescending { - it.originServerTs ?: 0 - }.forEachIndexed { index, timelineEvent -> + sourceEvents.forEachIndexed { index, timelineEvent -> val evDate = Calendar.getInstance().apply { timeInMillis = timelineEvent.originServerTs diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt index 576ef5e91a..cde65463d7 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt @@ -20,12 +20,15 @@ import com.squareup.inject.assisted.Assisted import com.squareup.inject.assisted.AssistedInject import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.session.Session +import im.vector.matrix.android.api.session.crypto.MXCryptoError import im.vector.matrix.android.api.session.events.model.Event import im.vector.matrix.android.api.session.events.model.toModel import im.vector.matrix.android.api.session.room.model.message.MessageContent import im.vector.matrix.android.api.session.room.model.message.isReply +import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult import im.vector.riotx.core.platform.VectorViewModel import im.vector.riotx.features.home.room.detail.timeline.helper.TimelineDateFormatter +import java.util.* data class ViewEditHistoryViewState( @@ -79,16 +82,36 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted } override fun onSuccess(data: List) { - //TODO until supported by API Add original event manually - val withOriginal = data.toMutableList() var originalIsReply = false - room.getTimeLineEvent(eventId)?.let { - withOriginal.add(it.root) - originalIsReply = it.root.getClearContent().toModel().isReply() + + val events = data.map { + val timelineID = it.roomId + UUID.randomUUID().toString() + it.apply { + //We need to check encryption + if (isEncrypted() && mxDecryptionResult == null) { + //for now decrypt sync + try { + val result = session.decryptEvent(this, timelineID) + mxDecryptionResult = OlmDecryptionResult( + payload = result.clearEvent, + senderKey = result.senderCurve25519Key, + keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) }, + forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain + ) + } catch (e: MXCryptoError) { + + } + } + + if (it.eventId == eventId) { + originalIsReply = getClearContent().toModel().isReply() + } + } + } setState { copy( - editList = Success(withOriginal), + editList = Success(events), isOriginalAReply = originalIsReply ) } diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 42050482bb..3a0d2d1dc5 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -27,12 +27,14 @@ import dagger.Lazy import im.vector.matrix.android.api.permalinks.MatrixLinkify import im.vector.matrix.android.api.permalinks.MatrixPermalinkSpan import im.vector.matrix.android.api.session.events.model.RelationType +import im.vector.matrix.android.api.session.events.model.toModel import im.vector.matrix.android.api.session.room.model.EditAggregatedSummary import im.vector.matrix.android.api.session.room.model.message.* import im.vector.matrix.android.api.session.room.send.SendState import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.api.session.room.timeline.getLastMessageContent import im.vector.matrix.android.internal.crypto.attachments.toElementToDecrypt +import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent import im.vector.riotx.EmojiCompatFontProvider import im.vector.riotx.R import im.vector.riotx.core.epoxy.VectorEpoxyModel @@ -83,7 +85,9 @@ class MessageItemFactory @Inject constructor( ?: //Malformed content, we should echo something on screen return DefaultItem_().text(stringProvider.getString(R.string.malformed_message)) - if (messageContent.relatesTo?.type == RelationType.REPLACE) { + if (messageContent.relatesTo?.type == RelationType.REPLACE + || event.isEncrypted() && event.root.content.toModel()?.relatesTo?.type == RelationType.REPLACE + ) { // ignore replace event, the targeted id is already edited return BlankItem_() } @@ -229,7 +233,8 @@ class MessageItemFactory @Inject constructor( val (maxWidth, maxHeight) = timelineMediaSizeProvider.getMaxSize() val thumbnailData = ImageContentRenderer.Data( filename = messageContent.body, - url = messageContent.videoInfo?.thumbnailFile?.url ?: messageContent.videoInfo?.thumbnailUrl, + url = messageContent.videoInfo?.thumbnailFile?.url + ?: messageContent.videoInfo?.thumbnailUrl, elementToDecrypt = messageContent.videoInfo?.thumbnailFile?.toElementToDecrypt(), height = messageContent.videoInfo?.height, maxHeight = maxHeight, From 7d413529181c286bc6c9050fc81138d3dd3106c2 Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 17 Jul 2019 16:46:03 +0200 Subject: [PATCH 02/19] Fix / edit reply was quoting wrong text + e2e reply of edit --- CHANGES.md | 1 + .../session/room/model/relation/RelationService.kt | 6 ++---- .../api/session/room/timeline/TimelineEvent.kt | 3 ++- .../room/relation/DefaultRelationService.kt | 5 ++--- .../session/room/send/LocalEchoEventFactory.kt | 14 +++++++------- .../home/room/detail/RoomDetailViewModel.kt | 6 +++++- 6 files changed, 19 insertions(+), 16 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7cffa1ff8b..7fcf6842cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ Changes in RiotX 0.2.1 (2019-XX-XX) Features: - Message Editing: View edit history (#121) - Rooms filtering (#304) + - Edit in encrypted room Improvements: - Handle click on redacted events: view source and create permalink diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt index da91ee70be..0c4e1bebc1 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/relation/RelationService.kt @@ -85,14 +85,12 @@ interface RelationService { * Edit a reply. This is a special case because replies contains fallback text as a prefix. * This method will take the new body (stripped from fallbacks) and re-add them before sending. * @param replyToEdit The event to edit - * @param originalSenderId the sender of the message that this reply (being edited) is relating to - * @param originalEventId the event id that this reply (being edited) is relating to + * @param originalTimelineEvent the message that this reply (being edited) is relating to * @param newBodyText The edited body (stripped from in reply to content) * @param compatibilityBodyText The text that will appear on clients that don't support yet edition */ fun editReply(replyToEdit: TimelineEvent, - originalSenderId: String?, - originalEventId : String, + originalTimelineEvent: TimelineEvent, newBodyText: String, compatibilityBodyText: String = "* $newBodyText"): Cancelable diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt index 761c39618f..044aa957f3 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/timeline/TimelineEvent.kt @@ -24,6 +24,7 @@ import im.vector.matrix.android.api.session.room.model.message.MessageContent import im.vector.matrix.android.api.session.room.model.message.isReply import im.vector.matrix.android.api.session.room.send.SendState import im.vector.matrix.android.api.util.ContentUtils.extractUsefulTextFromReply +import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent /** * This data class is a wrapper around an Event. It allows to get useful data in the context of a timeline. @@ -94,7 +95,7 @@ fun TimelineEvent.getLastMessageContent(): MessageContent? = annotations?.editSu fun TimelineEvent.getTextEditableContent(): String? { val originalContent = root.getClearContent().toModel() ?: return null - val isReply = originalContent.isReply() + val isReply = originalContent.isReply() || root.content.toModel()?.relatesTo?.inReplyTo?.eventId != null val lastContent = getLastMessageContent() return if (isReply) { return extractUsefulTextFromReply(lastContent?.body ?: "") diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt index 025de46279..183f2a6c2c 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/relation/DefaultRelationService.kt @@ -142,14 +142,13 @@ internal class DefaultRelationService @Inject constructor(private val context: C } override fun editReply(replyToEdit: TimelineEvent, - originalSenderId: String?, - originalEventId: String, + originalEvent: TimelineEvent, newBodyText: String, compatibilityBodyText: String): Cancelable { val event = eventFactory .createReplaceTextOfReply(roomId, replyToEdit, - originalSenderId, originalEventId, + originalEvent, newBodyText, true, MessageType.MSGTYPE_TEXT, compatibilityBodyText) .also { saveLocalEcho(it) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt index 40390d5d46..c6b6864704 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/send/LocalEchoEventFactory.kt @@ -105,28 +105,28 @@ internal class LocalEchoEventFactory @Inject constructor(private val credentials } fun createReplaceTextOfReply(roomId: String, eventReplaced: TimelineEvent, - originalSenderId: String?, - originalEventId: String, + originalEvent: TimelineEvent, newBodyText: String, newBodyAutoMarkdown: Boolean, msgType: String, compatibilityText: String): Event { - val permalink = PermalinkFactory.createPermalink(roomId, originalEventId) - val userLink = originalSenderId?.let { PermalinkFactory.createPermalink(it) } ?: "" + val permalink = PermalinkFactory.createPermalink(roomId, originalEvent.root.eventId ?: "") + val userLink = originalEvent.root.senderId?.let { PermalinkFactory.createPermalink(it) } + ?: "" - val body = bodyForReply(eventReplaced.getLastMessageContent(), eventReplaced.root.getClearContent().toModel()) + val body = bodyForReply(originalEvent.getLastMessageContent(), originalEvent.root.getClearContent().toModel()) val replyFormatted = REPLY_PATTERN.format( permalink, stringProvider.getString(R.string.message_reply_to_prefix), userLink, - originalSenderId, + originalEvent.senderName ?: originalEvent.root.senderId, body.takeFormatted(), createTextContent(newBodyText, newBodyAutoMarkdown).takeFormatted() ) // // > <@alice:example.org> This is the original body // - val replyFallback = buildReplyFallback(body, originalSenderId, newBodyText) + val replyFallback = buildReplyFallback(body, originalEvent.root.senderId ?: "", newBodyText) return createEvent(roomId, MessageTextContent( diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt index a15eae5b97..d38561fa88 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailViewModel.kt @@ -38,6 +38,7 @@ import im.vector.matrix.android.api.session.room.model.message.MessageType import im.vector.matrix.android.api.session.room.model.message.getFileUrl import im.vector.matrix.android.api.session.room.timeline.TimelineEvent import im.vector.matrix.android.internal.crypto.attachments.toElementToDecrypt +import im.vector.matrix.android.internal.crypto.model.event.EncryptedEventContent import im.vector.matrix.rx.rx import im.vector.riotx.core.intent.getFilenameFromUri import im.vector.riotx.core.platform.VectorViewModel @@ -229,9 +230,12 @@ class RoomDetailViewModel @AssistedInject constructor(@Assisted initialState: Ro //is original event a reply? val inReplyTo = state.sendMode.timelineEvent.root.getClearContent().toModel()?.relatesTo?.inReplyTo?.eventId + ?: state.sendMode.timelineEvent.root.content.toModel()?.relatesTo?.inReplyTo?.eventId if (inReplyTo != null) { //TODO check if same content? - room.editReply(state.sendMode.timelineEvent, room.getTimeLineEvent(inReplyTo)?.root?.senderId, inReplyTo, action.text) + room.getTimeLineEvent(inReplyTo)?.let { + room.editReply(state.sendMode.timelineEvent, it, action.text) + } } else { val messageContent: MessageContent? = state.sendMode.timelineEvent.annotations?.editSummary?.aggregatedContent.toModel() From 7e3b300130055c810385c7439ddd18bda0712776 Mon Sep 17 00:00:00 2001 From: ganfra Date: Wed, 17 Jul 2019 19:45:35 +0200 Subject: [PATCH 03/19] Fix sync state progress bar --- .../android/internal/session/sync/job/SyncThread.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt index 65c79bd8a0..6a54ad3331 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt @@ -54,8 +54,9 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, updateStateTo(SyncState.IDLE) } - fun setInitialForeground(initialForground : Boolean) { - updateStateTo(if (initialForground) SyncState.IDLE else SyncState.PAUSED) + fun setInitialForeground(initialForeground: Boolean) { + val newState = if (initialForeground) SyncState.IDLE else SyncState.PAUSED + updateStateTo(newState) } fun restart() = synchronized(lock) { @@ -96,7 +97,9 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, lock.wait() } } else { - updateStateTo(SyncState.RUNNING(catchingUp = true)) + if (state !is SyncState.RUNNING) { + updateStateTo(SyncState.RUNNING(catchingUp = true)) + } Timber.v("[$this] Execute sync request with timeout $DEFAULT_LONG_POOL_TIMEOUT") val latch = CountDownLatch(1) val params = SyncTask.Params(DEFAULT_LONG_POOL_TIMEOUT) From 51fdccb3930fb10b04d88ecd1a7754a834a07ba8 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 18 Jul 2019 09:29:27 +0200 Subject: [PATCH 04/19] cleaning --- .../room/EventRelationsAggregationTask.kt | 3 ++- .../action/ViewEditHistoryViewModel.kt | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt index f8c1024d2a..867ca2874f 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/room/EventRelationsAggregationTask.kt @@ -118,7 +118,8 @@ internal class DefaultEventRelationsAggregationTask @Inject constructor( forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain ) } catch (e: MXCryptoError) { - + Timber.w("Failed to decrypt e2e replace") + //TODO -> we should keep track of this and retry, or aggregation will be broken } } event.getClearContent().toModel()?.let { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt index cde65463d7..6ad172101a 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/action/ViewEditHistoryViewModel.kt @@ -28,6 +28,7 @@ import im.vector.matrix.android.api.session.room.model.message.isReply import im.vector.matrix.android.internal.crypto.algorithms.olm.OlmDecryptionResult import im.vector.riotx.core.platform.VectorViewModel import im.vector.riotx.features.home.room.detail.timeline.helper.TimelineDateFormatter +import timber.log.Timber import java.util.* @@ -84,27 +85,27 @@ class ViewEditHistoryViewModel @AssistedInject constructor(@Assisted override fun onSuccess(data: List) { var originalIsReply = false - val events = data.map { - val timelineID = it.roomId + UUID.randomUUID().toString() - it.apply { + val events = data.map { event -> + val timelineID = event.roomId + UUID.randomUUID().toString() + event.also { //We need to check encryption - if (isEncrypted() && mxDecryptionResult == null) { + if (it.isEncrypted() && it.mxDecryptionResult == null) { //for now decrypt sync try { - val result = session.decryptEvent(this, timelineID) - mxDecryptionResult = OlmDecryptionResult( + val result = session.decryptEvent(it, timelineID) + it.mxDecryptionResult = OlmDecryptionResult( payload = result.clearEvent, senderKey = result.senderCurve25519Key, keysClaimed = result.claimedEd25519Key?.let { k -> mapOf("ed25519" to k) }, forwardingCurve25519KeyChain = result.forwardingCurve25519KeyChain ) } catch (e: MXCryptoError) { - + Timber.w("Failed to decrypt event in history") } } - if (it.eventId == eventId) { - originalIsReply = getClearContent().toModel().isReply() + if (event.eventId == it.eventId) { + originalIsReply = it.getClearContent().toModel().isReply() } } From 0afde3b0216ff35ff7523e970deab260b30befd7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:07:09 +0200 Subject: [PATCH 05/19] Rename class member for code clarity --- .../im/vector/matrix/android/api/session/sync/SyncState.kt | 2 +- .../matrix/android/internal/session/sync/job/SyncThread.kt | 6 +++--- .../im/vector/riotx/features/home/HomeDetailFragment.kt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt index a2af70f401..cc1c3f1a32 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/sync/SyncState.kt @@ -18,7 +18,7 @@ package im.vector.matrix.android.api.session.sync sealed class SyncState { object IDLE : SyncState() - data class RUNNING(val catchingUp: Boolean) : SyncState() + data class RUNNING(val afterPause: Boolean) : SyncState() object PAUSED : SyncState() object KILLING : SyncState() object KILLED : SyncState() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt index 6a54ad3331..6f0021641a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt @@ -62,7 +62,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, fun restart() = synchronized(lock) { if (state is SyncState.PAUSED) { Timber.v("Resume sync...") - updateStateTo(SyncState.RUNNING(catchingUp = true)) + updateStateTo(SyncState.RUNNING(afterPause = true)) lock.notify() } } @@ -98,7 +98,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, } } else { if (state !is SyncState.RUNNING) { - updateStateTo(SyncState.RUNNING(catchingUp = true)) + updateStateTo(SyncState.RUNNING(afterPause = true)) } Timber.v("[$this] Execute sync request with timeout $DEFAULT_LONG_POOL_TIMEOUT") val latch = CountDownLatch(1) @@ -140,7 +140,7 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, latch.await() if (state is SyncState.RUNNING) { - updateStateTo(SyncState.RUNNING(catchingUp = false)) + updateStateTo(SyncState.RUNNING(afterPause = false)) } Timber.v("Waiting for $DEFAULT_LONG_POOL_DELAY delay before new pool...") diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt index db8ae35950..bd4b2ca4df 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt @@ -209,7 +209,7 @@ class HomeDetailFragment : VectorBaseFragment(), KeysBackupBanner.Delegate { unreadCounterBadgeViews[INDEX_PEOPLE].render(UnreadCounterBadgeView.State(it.notificationCountPeople, it.notificationHighlightPeople)) unreadCounterBadgeViews[INDEX_ROOMS].render(UnreadCounterBadgeView.State(it.notificationCountRooms, it.notificationHighlightRooms)) syncProgressBar.visibility = when (it.syncState) { - is SyncState.RUNNING -> if (it.syncState.catchingUp) View.VISIBLE else View.GONE + is SyncState.RUNNING -> if (it.syncState.afterPause) View.VISIBLE else View.GONE else -> View.GONE } syncProgressBarWrap.visibility = syncProgressBar.visibility From d48ae967bd77ae22cc7514c7b0d8b5b74f2f8985 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:11:42 +0200 Subject: [PATCH 06/19] Remove dead code --- .../matrix/android/internal/session/sync/job/SyncThread.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt index 6f0021641a..c08f6101b2 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/sync/job/SyncThread.kt @@ -37,7 +37,6 @@ import javax.inject.Inject private const val RETRY_WAIT_TIME_MS = 10_000L private const val DEFAULT_LONG_POOL_TIMEOUT = 30_000L -private const val DEFAULT_LONG_POOL_DELAY = 0L internal class SyncThread @Inject constructor(private val syncTask: SyncTask, private val networkConnectivityChecker: NetworkConnectivityChecker, @@ -143,8 +142,6 @@ internal class SyncThread @Inject constructor(private val syncTask: SyncTask, updateStateTo(SyncState.RUNNING(afterPause = false)) } - Timber.v("Waiting for $DEFAULT_LONG_POOL_DELAY delay before new pool...") - if (DEFAULT_LONG_POOL_DELAY > 0) sleep(DEFAULT_LONG_POOL_DELAY) Timber.v("...Continue") } } From 21ba72e5e7e410c1e7955d0feb46e9c37f2ea634 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:34:49 +0200 Subject: [PATCH 07/19] Do not show invitation in the filtered room list --- .../riotx/features/home/room/list/RoomSummaryController.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt index 97922b8f38..c439ea20bf 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt @@ -18,6 +18,7 @@ package im.vector.riotx.features.home.room.list import androidx.annotation.StringRes import com.airbnb.epoxy.TypedEpoxyController +import im.vector.matrix.android.api.session.room.model.Membership import im.vector.matrix.android.api.session.room.model.RoomSummary import im.vector.riotx.core.resources.StringProvider import im.vector.riotx.features.home.room.filtered.FilteredRoomFooterItem @@ -62,7 +63,8 @@ class RoomSummaryController @Inject constructor(private val stringProvider: Stri roomListNameFilter.filter = viewState.roomFilter - val filteredSummaries = summaries.filter { roomListNameFilter.test(it) } + val filteredSummaries = summaries + .filter { it.membership == Membership.JOIN && roomListNameFilter.test(it) } buildRoomModels(filteredSummaries, viewState.joiningRoomsIds, From fe88aaffbdc7843bef98b1629be47baf371e40a4 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 11:39:13 +0200 Subject: [PATCH 08/19] Inject RoomListNameFilter --- .../riotx/features/home/HomeRoomListObservableStore.kt | 4 ---- .../riotx/features/home/room/list/RoomListNameFilter.kt | 3 ++- .../riotx/features/home/room/list/RoomSummaryController.kt | 5 ++--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt index 4e0b5b70ed..df8cd411bb 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeRoomListObservableStore.kt @@ -18,10 +18,6 @@ package im.vector.riotx.features.home import im.vector.matrix.android.api.session.room.model.RoomSummary import im.vector.riotx.core.utils.RxStore -import im.vector.riotx.features.home.room.list.RoomListDisplayModeFilter -import im.vector.riotx.features.home.room.list.RoomListFragment -import io.reactivex.Observable -import io.reactivex.schedulers.Schedulers import javax.inject.Inject import javax.inject.Singleton diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt index e9dd9813b4..7bb5c305aa 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomListNameFilter.kt @@ -18,8 +18,9 @@ package im.vector.riotx.features.home.room.list import im.vector.matrix.android.api.session.room.model.RoomSummary import io.reactivex.functions.Predicate +import javax.inject.Inject -class RoomListNameFilter : Predicate { +class RoomListNameFilter @Inject constructor() : Predicate { var filter: String = "" diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt index c439ea20bf..03bedbc7b5 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/list/RoomSummaryController.kt @@ -26,13 +26,12 @@ import im.vector.riotx.features.home.room.filtered.filteredRoomFooterItem import javax.inject.Inject class RoomSummaryController @Inject constructor(private val stringProvider: StringProvider, - private val roomSummaryItemFactory: RoomSummaryItemFactory + private val roomSummaryItemFactory: RoomSummaryItemFactory, + private val roomListNameFilter: RoomListNameFilter ) : TypedEpoxyController() { var listener: Listener? = null - private val roomListNameFilter = RoomListNameFilter() - override fun buildModels(viewState: RoomListViewState) { if (viewState.displayMode == RoomListFragment.DisplayMode.FILTERED) { buildFilteredRooms(viewState) From 5438207fba61fdf330a70fda1d30aadb8e3db34a Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 18 Jul 2019 12:01:23 +0200 Subject: [PATCH 09/19] faster animation for quick reply --- .../riotx/features/home/room/detail/RoomDetailFragment.kt | 5 ++--- .../features/home/room/detail/composer/TextComposerView.kt | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 55ee4dfa1e..aeb3f05fe4 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -269,9 +269,8 @@ class RoomDetailFragment : ?: "", event.senderName, composerLayout.composerRelatedMessageAvatar) composerLayout.composerEditText.setSelection(composerLayout.composerEditText.text.length) - composerLayout.expand { - focusComposerAndShowKeyboard() - } + composerLayout.expand() + focusComposerAndShowKeyboard() } override fun onResume() { diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt index 488ecbd334..4a3fc3ffad 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/composer/TextComposerView.kt @@ -57,6 +57,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib var currentConstraintSetId: Int = -1 + private val animationDuration = 100L init { inflate(context, R.layout.merge_composer_layout, this) @@ -73,7 +74,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib currentConstraintSetId = R.layout.constraint_set_composer_layout_compact if (animate) { val transition = AutoTransition() -// transition.duration = 5000 + transition.duration = animationDuration transition.addListener(object : Transition.TransitionListener { override fun onTransitionEnd(transition: Transition) { @@ -105,7 +106,7 @@ class TextComposerView @JvmOverloads constructor(context: Context, attrs: Attrib currentConstraintSetId = R.layout.constraint_set_composer_layout_expanded if (animate) { val transition = AutoTransition() -// transition.duration = 5000 + transition.duration = animationDuration transition.addListener(object : Transition.TransitionListener { override fun onTransitionEnd(transition: Transition) { From 9c67036c085285df6cbcf05762f15a9c1405825f Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 18 Jul 2019 12:13:17 +0200 Subject: [PATCH 10/19] Fix / keyboard won't show when using reply from long tap menu --- .../riotx/features/home/room/detail/RoomDetailFragment.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index aeb3f05fe4..b7491ae6b2 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -269,7 +269,10 @@ class RoomDetailFragment : ?: "", event.senderName, composerLayout.composerRelatedMessageAvatar) composerLayout.composerEditText.setSelection(composerLayout.composerEditText.text.length) - composerLayout.expand() + composerLayout.expand { + //need to do it here also when not using quick reply + focusComposerAndShowKeyboard() + } focusComposerAndShowKeyboard() } From e218691bf2d1fc2b300cea5f5621dc12dd15a138 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 14:24:48 +0200 Subject: [PATCH 11/19] Import strings and translation from Riot --- .../src/main/res/values-eu/strings.xml | 2 +- .../src/main/res/values-ko/strings.xml | 1 + .../src/main/res/values/strings.xml | 10 +++ .../src/main/res/values/strings_RiotX.xml | 10 +-- vector/src/main/res/values-bg/strings.xml | 53 ++++++++++++++ vector/src/main/res/values-eu/strings.xml | 55 +++++++++++++- vector/src/main/res/values-fi/strings.xml | 19 ++++- vector/src/main/res/values-fr/strings.xml | 53 ++++++++++++++ vector/src/main/res/values-hu/strings.xml | 53 ++++++++++++++ vector/src/main/res/values-it/strings.xml | 53 ++++++++++++++ vector/src/main/res/values-ko/strings.xml | 73 +++++++++++++++++-- vector/src/main/res/values-sq/strings.xml | 47 ++++++++++++ vector/src/main/res/values-zh-rTW/strings.xml | 53 ++++++++++++++ vector/src/main/res/values/strings.xml | 35 +++++++++ vector/src/main/res/values/strings_riotX.xml | 36 --------- 15 files changed, 498 insertions(+), 55 deletions(-) diff --git a/matrix-sdk-android/src/main/res/values-eu/strings.xml b/matrix-sdk-android/src/main/res/values-eu/strings.xml index 00bcf69ecd..a211ea04af 100644 --- a/matrix-sdk-android/src/main/res/values-eu/strings.xml +++ b/matrix-sdk-android/src/main/res/values-eu/strings.xml @@ -119,7 +119,7 @@ Robota Txanoa Betaurrekoak - Giltza ingelesa + Giltza Santa Ederto Aterkia diff --git a/matrix-sdk-android/src/main/res/values-ko/strings.xml b/matrix-sdk-android/src/main/res/values-ko/strings.xml index ede965c176..faf1840a8d 100644 --- a/matrix-sdk-android/src/main/res/values-ko/strings.xml +++ b/matrix-sdk-android/src/main/res/values-ko/strings.xml @@ -2,4 +2,5 @@ %1$s: %2$s %s\'의 초대 + 헤드폰 diff --git a/matrix-sdk-android/src/main/res/values/strings.xml b/matrix-sdk-android/src/main/res/values/strings.xml index be64a65974..5459cf9124 100644 --- a/matrix-sdk-android/src/main/res/values/strings.xml +++ b/matrix-sdk-android/src/main/res/values/strings.xml @@ -228,4 +228,14 @@ Pin + + Initial Sync:\nImporting account… + Initial Sync:\nImporting crypto + Initial Sync:\nImporting Rooms + Initial Sync:\nImporting Joined Rooms + Initial Sync:\nImporting Invited Rooms + Initial Sync:\nImporting Left Rooms + Initial Sync:\nImporting Communities + Initial Sync:\nImporting Account Data + diff --git a/matrix-sdk-android/src/main/res/values/strings_RiotX.xml b/matrix-sdk-android/src/main/res/values/strings_RiotX.xml index d03dfa79b9..0d2c4cc409 100644 --- a/matrix-sdk-android/src/main/res/values/strings_RiotX.xml +++ b/matrix-sdk-android/src/main/res/values/strings_RiotX.xml @@ -1,10 +1,4 @@ + - Initial Sync:\nImporting account… - Initial Sync:\nImporting crypto - Initial Sync:\nImporting Rooms - Initial Sync:\nImporting Joined Rooms - Initial Sync:\nImporting Invited Rooms - Initial Sync:\nImporting Left Rooms - Initial Sync:\nImporting Communities - Initial Sync:\nImporting Account Data + \ No newline at end of file diff --git a/vector/src/main/res/values-bg/strings.xml b/vector/src/main/res/values-bg/strings.xml index b2f1bd8903..9f6fad407c 100644 --- a/vector/src/main/res/values-bg/strings.xml +++ b/vector/src/main/res/values-bg/strings.xml @@ -1515,4 +1515,57 @@ Случи се грешка при извличане на информацията за довереността Случи се грешка при извличане на резервните данни за ключовете + Добре дошли в beta версията! + Докато RiotX е в ранен стадий на разработка някои функции може да липсват или да има бъгове. + Play Store описание + Ако намерите бъгове, моля докладвайте ги от най-горното ляво меню на началния екран и ще ги разрешим възможно най-бързо. + + Импортирай e2e ключове от файл \"%1$s\". + + Matrix SDK версия + Вече гледате тази стая! + + Бързи реакции + + Основни + Настройки + Сигурност и поверителност + Експертни + Правила за уведомление + Не са дефинирани правила за уведомление + Списъкът с последни функции винаги е в %1$s. Ако намерите бъг, изпратете доклад за грешка от менюто горе в ляво, и ще го поправим възможно най-скоро. + Други известия + Не са регистрирани адреси за push уведомления + + app_id: + push_key: + app_display_name: + device_name: + Адрес: + Формат: + + Глас и Видео + Помощ и Относно + + + Регистрирай токен + + Направи предложение + Напишете предложението си долу. + Опишете предложението тук + Благодаря! Предложението ви беше изпратено + Предложението не беше изпратено (%s) + + Показвай скрити събития в чата + + RiotX - следващо поколение Matrix клиент + По-бърз и по-лек Matrix клиент, използващ последните Android технологии + RiotX в нов клиент за Matrix протокола (Matrix.org): отворена мрежа за сигурна, децентрализирана комуникация. RiotX е изцяло пренаписан Riot Android клиент, базиран на изцяло пренаписан Matrix Android SDK. +\n +\nЗабележка: Това е бета версия. RiotX в момента се разработва активно и все още има ограничения и (надяваме се не прекалено много) бъгове. Всякаква обратна връзка е добре дошла! +\n +\nRiotX поддържа: • Вход в съществуващ акаунт • Създаване на стая и влизане в публични стаи • Приемане и отхвърляне на покани • Показване на списък със стаите • Преглеждане на информация за стая • Изпращане на текстови съобщения • Изпращане на прикачени файлове • Четене и писане на съобщения в шифровани стаи • Шифроване: резервни копия на E2E ключове, потвърждение на устройства, заявяване и отговаряне на заявки за споделяне на ключове • Уведомления • Светла, Тъмна и Черна тема +\n +\nЗасега не всички функции на Riot са налични в RiotX. Основни липсващи (и скоро пристигащи!) функции са: • Създаване на нов профил • Настройки на стаи (показване на членове и т.н.) • Създаване на директни чатове • Обаждания • Приспособления • … + diff --git a/vector/src/main/res/values-eu/strings.xml b/vector/src/main/res/values-eu/strings.xml index 393b7a0d7e..a3846d5d35 100644 --- a/vector/src/main/res/values-eu/strings.xml +++ b/vector/src/main/res/values-eu/strings.xml @@ -1476,7 +1476,7 @@ Abisua: Fitxategi hau ezabatu daiteke aplikazioa desinstalatzen bada. Gonbidapen bat bidali dizu %s erabiltzaileak gonbidatuta - Arrapatu zaituztete! + Egunean zaude! Ez duzu irakurri gabeko mezu gehiagorik Ongi etorri etxera! Jarri egunean hemengo irakurri gabeko mezuekin @@ -1522,4 +1522,57 @@ Abisua: Fitxategi hau ezabatu daiteke aplikazioa desinstalatzen bada. Errore bat gertatu da konfiantzazko informazioa jasotzean Errore bat gertatu da gakoen babes-kopiaren datuak jasotzean + Ongi etorri betara! + Riot X oraindik garapenean dagoenez, ezaugarri batzuk faltan bota ditzakezu eta akatsen bat aurkitu dezakezu. + Azken ezaugarrien zerrenda hemen dago beti : %1$s, eta akatsak aurkitzen badituzu bidali mesedez akatsen txosten bat Hasiera pantailako goi ezkerreko menua erabiliz, eta ahalik eta lasterren konponduko dugu. + Play Store-ko deskripzioa + Akatsak aurkitzen badituzu bidali mesedez akatsen txosten bat Hasiera pantailako goi ezkerreko menua erabiliz, eta ahalik eta lasterren konponduko dugu. + + "Inportatu e2e gakoak \"%1$s\" fitxategitik." + + Matrix SDK bertsioa + Beste hirugarrengoen adierazpenak + Gela hau ikusten ari zara dagoeneko! + + Erreakzio azkarrak + + Orokorra + Hobespenak + Segurtasuna eta pribatutasuna + Aditua + Push arauak + Ez da push araurik zehaztu + Ez dago push arauentzako erregistratutako atebiderik + + app_id: + push_gakoa: + gailu_izena: + Url-a: + Formatua: + + Ahotsa eta bideoa + Laguntza eta honi buruz + + + Erregistratu token-a + + Egin iradokizun bat + Idatzi zure iradokizuna azpian. + Deskribatu zure iradokizuna hemen + Eskerrik asko, iradokizuna ongi bidali da + Huts egin su iradokizuna bidaltzean (%s) + + Erakutsi ezkutatutako gertaerak denbora lerroan + + RiotX - Hurrengo belaunaldiko Matrix bezeroa + Matrix-erako bezero azkarrago eta arinago bat azken Android tresnak erabiliz eginak + RiotX bezero berri bat da Matrix protokoloarentzako (Matrix.org): komunikazioa seguru eta deszentralizatuarentzako sare libre bat. RiotX Android plataformarako Riot bezeroaren berridazketa oso bat da, erabat berridatzitako Android SDK-n oinarritua. +\n +\nAbisua: hau beta bertsio bat da. RiotX garapen aktiboan dago eta baditu mugak zein akatsak (gehiegi ez espero dugu). Iruzkin guztiak ongi etorriak dira! +\n +\nRiotX bezeroak honakoa ahalbidetzen du: • Badagoen kontu batean saioa hasi • Gelak sortu eta gela publikoetara elkartu • Gonbidapenak onartu edo ukatu • Erabiltzailearen gelak zerrendatu • Gelaren xehetasunak ikusi • Testuzko mezuak bidali • Eranskinak bidali • Zifratutako geletan mezuak irakurri eta idatzi • Zifratzea: E2Egakoen babeskopia, gailuaren egiaztaketa aurreratua, gakoa partekatzeko eskaria eta erantzuna • Push jakinarazpena • Gai argia, iluna eta beltza +\n +\nEz dira oraindik Riot bezeroaren ezaugarri guztiak ezarri RiotX bezeroan. Falta diren (eta laster etorriko direnen) artean nabarmenak dira: • Kontua sortzea • Gelaren ezarpenak (gelako kideak zerrendatzea, eta abar.) • Txat zuzenerako gelak sortzea • Deiak • Trepetak • … + + app_display_name: diff --git a/vector/src/main/res/values-fi/strings.xml b/vector/src/main/res/values-fi/strings.xml index d84267a0de..9e2418416d 100644 --- a/vector/src/main/res/values-fi/strings.xml +++ b/vector/src/main/res/values-fi/strings.xml @@ -768,10 +768,10 @@ Varoitus! - Konferenssipuhelu on yhtä kehitysvaiheessa eikä välttämättä ole luotettava. + Konferenssipuhelut ovat kehitysvaiheessa eivätkä välttämättä luotettavia. - Virheellinen komento + Komentovirhe Tuntematon komento: %s @@ -1166,7 +1166,7 @@ Haluatko lisätä paketteja? Käytä näppäimistön rivinvaihtopainiketta viestin lähettämiseen Tämä vaihtoehto vaatii kolmannen osapuolen sovelluksen viestien tallennukseen. - Komento ”%s” vaatii enemmän parametreja, tai jotkinparametrit ovat väärin. + Komento ”%s” vaatii enemmän parametreja, tai jotkin parametrit ovat virheellisiä. Näyttää toiminnon Estää käyttäjän annetulla id:llä Sallii käyttäjän annetulla id:llä @@ -1520,4 +1520,17 @@ Jotta et menetä mitään, automaattiset päivitykset kannattaa pitää käytös Luottamustietoa haettaessa tapahtui virhe Avainten varmuuskopioinnin tietoja haettaessa tapahtui virhe + Tuntematon laite pyytää salausavaimia +\nLaitteen nimi: %1$s +\nViimeksi nähty: %2$s +\nJos et kirjautunut toisella laitteella, voit jättää tämän pyynnön huomiotta. + + Tervetuloa beetaan! + Riot X on varhaisessa kehitysvaiheessa, mistä johtuen osa ominaisuuksista puuttuu ja saatat kohdata virheitä. + Matrix SDK:n versio + Muut kolmansien osapuolten huomautukset + Pikareaktiot + + Asetukset + Tietoturva ja yksityisyys diff --git a/vector/src/main/res/values-fr/strings.xml b/vector/src/main/res/values-fr/strings.xml index cd91650b2b..d0f39271bc 100644 --- a/vector/src/main/res/values-fr/strings.xml +++ b/vector/src/main/res/values-fr/strings.xml @@ -1527,4 +1527,57 @@ Si vous n’avez pas configuré de nouvelle méthode de récupération, un attaq Une erreur est survenue lors de la récupération des informations de confiance Une erreur est survenue lors de la récupération des données de sauvegarde de clés + Bienvenue à la bêta ! + Comme RiotX est au début de son développement, il se peut que certaines fonctionnalités soient manquantes et que vous rencontriez quelques anomalies. + La dernière liste de fonctionnalités est toujours dans la %1$s, et si vous rencontrez des anomalies, envoyez un rapport dans le menu en haut à gauche de l’accueil et nous les règlerons aussi vite que possible. + description du Play Store + Si vous rencontrez des anomalies, envoyez un rapport dans le menu en haut à gauche de l’accueil et nous les règlerons aussi vite que possible. + + Importer les clés de chiffrement depuis le fichier « %1$s ». + + Version du SDK de Matrix + Licences tierces + Vous êtes déjà en train de visualiser ce salon ! + + Réactions rapides + + Général + Préférences + Sécurité & vie privée + Expert + Règles de notification + Aucune règle de notification définie + Aucune passerelle de notification enregistrée + + app_id : + push_key : + app_display_name : + device_name : + URL : + Format : + + Voix & vidéo + Aide & à propos + + + Inscrire le jeton + + Faire une suggestion + Saisissez votre suggestion ci-dessous. + Décrivez votre suggestion ici + Merci, la suggestion a bien été envoyée + Échec d’envoi de la suggestion (%s) + + Afficher les évènements cachés dans l’historique + + RiotX − Client Matrix nouvelle génération + Un client pour Matrix plus rapide et plus léger utilisant les derniers frameworks Android + RiotX est un nouveau client pour le protocole Matrix (Matrix.org) : un réseau ouvert pour des communications sécurisées et décentralisées. RiotX est une réécriture complète du client Android Riot, basée sur une réécriture complète du SDK Android de Matrix. +\n +\nMise en garde : Ceci est une version bêta. RiotX est actuellement en plein développement et a des limites et (peu, nous l’espérons) des anomalies. Tout commentaire est le bienvenu ! +\n +\nRiotX prend en charge : • Se connecter à un compte existant • Créer de salons et rejoindre des salons publics • Accepter et refuser des invitations • Lister les salons des utilisateurs • Voir les informations des salons • Envoyer des messages texte • Envoyer des pièces jointes • Lire et écrire des messages dans les salons chiffrés • Chiffrement : sauvegarde des clés de chiffrement, vérification avancée des appareils, demande et réponse de partage de clé • Notifications • Thèmes clair, sombre et noir +\n +\nToutes les fonctionnalités de Riot ne sont pas encore implémentées dans RiotX. Principales fonctionnalités manquantes (et qui arrivent bientôt !) : • Création de compte • Réglages des salons (lister les membres du salon etc.) • Création de salons de discussion directe • Appels • Widgets • … + diff --git a/vector/src/main/res/values-hu/strings.xml b/vector/src/main/res/values-hu/strings.xml index b8e19998c6..2f761b7ad4 100644 --- a/vector/src/main/res/values-hu/strings.xml +++ b/vector/src/main/res/values-hu/strings.xml @@ -1526,4 +1526,57 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró A megbízhatósági információ beszerzésekor hiba történt A kulcs mentés adatainak beszerzésekor hiba történt + Üdv a béta verzióban! + Amíg a Riot X újdonsült fejlesztés, néhány funkció hiányozhat és találkozhatsz hibákkal. + A legfrissebb funkciók listáját itt találod: %1$s, és ha hibát találsz kérlek küldj egy jelentést róla a Kezdő oldal bal felső sarkában lévő menüvel és ahogy tudjuk javítjuk. + Play áruház leírás + Ha hibát találsz kérlek küldj egy jelentést róla a Kezdő oldal bal felső sarkában lévő menüvel és ahogy tudjuk javítjuk. + + Végponttól végpontig titkosítás kulcsainak betöltése ebből a fájlból: \"%1$s\". + + Matrix SDK Verzió + Harmadik fél megjegyzések + Már nézed ezt a szobát! + + Gyors Reakció + + Általános + Beállítások + Biztonság & Adatvédelem + Haladó + „Push” szabályok + „Push” szabályok nincsenek + „Push” átjárók nincsenek regisztrálva + + app_id: + push_key: + app_display_name: + device_name: + Url: + Formátum: + + Hang & Videó + Segítség & Névjegy + + + „Token” regisztrálás + + Javaslat tétel + A javaslatodat kérlek ír le alulra. + Ír le a javaslatodat ide + Köszönjük, a javaslatodat sikeresen elküldtük + A javaslatot nem sikerült elküldeni (%s) + + Rejtett események megjelenítése az idővonalon + + RiotX - Matrix Kliens Új Nemzedéke + A gyorsabb és kisebb Matrix kliens ami a legfrissebb Android keretrendszert használja + RiotX a Matrix protokollhoz (Matrix.org) készült új kliens: nyílt hálózat biztonságos és decentralizált kommunikációhoz. RiotX a Riot Android kliens teljesen újraírt változata ami a teljesen újraírt Matrix Android SDK-ra épül. +\n +\nFigyelmeztetés: Ez egy béta verzió. RiotX aktív fejlesztés alatt áll és vannak korlátai és (reméljük nem olyan sok) hibái. Minden visszajelzést szívesen fogadunk! +\n +\nRiotX ezeket támogatja: • Bejelentkezés létező fiókba • Szoba készítés és nyilvános szobába való belépés • Meghívók fogadása és elutasítás • Felhasználók szobáinak listázása • Szoba adatainak megtekintése • Szöveges üzenet küldése • Csatolmány küldése • Titkosított szobákban üzenetek olvasása és írása • Titkosítás: Végponttól végpontig titkosító kulcsok mentése, fejlett eszköz ellenőrzés, kulcs megosztás kérése és válasz • „Push” értesítések • Világos, sötét és fekete téma +\n +\nNem minden Riot funkció támogatott a RiotX-ben jelenleg. A fő hiányzó (és hamarosan elérhető!) funkciók: • Felhasználói fiók létrehozása • Szoba beállítások (szoba tagság mutatása, stb…) • Közvetlen beszélgetések indítása • Hívások • Kisalkalmazások • … + diff --git a/vector/src/main/res/values-it/strings.xml b/vector/src/main/res/values-it/strings.xml index fd71786433..c2971aeb7c 100644 --- a/vector/src/main/res/values-it/strings.xml +++ b/vector/src/main/res/values-it/strings.xml @@ -1570,4 +1570,57 @@ Per essere certo di non perdere nulla, mantieni gli aggiornamenti attivi."Si è verificato un errore nell\'ottenere informazioni sulla fiducia Si è verificato un errore nell\'ottenere i dati del backup chiavi + Benvenuti nella beta! + Mentre Riot X si trova nella fase iniziale dello sviluppo, potrebbero mancare alcune funzioni e potrebbero verificarsi errori. + L\'elenco di funzioni più recenti è sempre nel %1$s, se trovi errori ti preghiamo segnalarli nel menu in alto a sinistra della Pagina Iniziale e noi li correggeremo appena possibile. + Descrizione nel Play Store + Se trovi errori ti preghiamo segnalarli nel menu in alto a sinistra della Pagina Iniziale e noi li correggeremo appena possibile. + + Importa chiavi e2e dal file \"%1$s\". + + Versione SDK Matrix + Altre note di terze parti + Stai già visualizzando questa stanza! + + Reazioni rapide + + Generali + Preferenze + Sicurezza e privacy + Esperto + Regole di push + Nessuna regola di push definita + Nessun gateway di push registrato + + id_app: + chiave_push: + nome_visualizzato_app: + nome_dispositivo: + Url: + Formato: + + Voce e video + Aiuto e informazioni + + + Registra token + + Suggerisci qualcosa + Scrivi qua sotto il tuo suggerimento. + Descrivi qui il tuo suggerimento + Grazie, il suggerimento è stato inviato correttamente + L\'invio del suggerimento è fallito (%s) + + Mostra eventi nascosti nella cronologia + + RiotX - Client Matrix di nuova generazione + Un client per Matrix più veloce e leggero usando gli ultimi framework di Android + RiotX è un nuovo client per il protocollo Matrix (Matrix.org): una rete aperta per comunicazioni sicure e decentralizzate. RiotX è una riscrittura totale del client Riot Android, basata su una riscrittura completa dell\'SDK Android di Matrix. +\n +\nDisclaimer: questa è una versione beta. RiotX è attualmente in uno sviluppo attivo e contiene limitazioni ed errori (speriamo non troppi). I suggerimenti sono ben accetti! +\n +\nRiotX supporta: • Accesso ad account esistente • Crea stanze ed entra in stanze pubbliche • Accetta e rifiuta inviti • Elenca stanze utenti • Vedi dettagli stanza • Invia messaggi di testo • Invia allegati • Leggi e scrivi messaggi in stanze cifrate • Crypto: backup chiavi E2E, verifica avanzata dispositivi, richiesta e risposta condivisione chiavi • Notifiche push • Tema chiaro, scuro e nero +\n +\nNon tutte le funzioni di Riot sono già implementate in RiotX. Principali funzioni mancanti (prossimamente!): • Creazione account • Impostazioni stanza (elenca membri stanza, ecc.) • Creazione di stanze di chat diretta • Chiamate • Widget • … + diff --git a/vector/src/main/res/values-ko/strings.xml b/vector/src/main/res/values-ko/strings.xml index eeabcc7a4e..5e357eb69b 100644 --- a/vector/src/main/res/values-ko/strings.xml +++ b/vector/src/main/res/values-ko/strings.xml @@ -7,7 +7,7 @@ 어두운 테마 검정 테마 - 동기화 + 동기화하는중… 메시지 설정 @@ -26,7 +26,7 @@ 보내기 복사 다시 보내기 - 삭제하기 + 지우기 인용 받기 공유 @@ -38,7 +38,7 @@ 컨텐츠 신고 음성 영상 - 전화를 걸 수 없습니다, 나중에 다시 시도해주세요. + 전화를 걸 수 없습니다, 나중에 다시 시도해주세요 권한이 없어졌기 때문에, 일부 기능이 빠졌을 수 있습니다… 권한이 없어졌기 때문에, 이 행동을 할 수 없습니다. 전화를 걸 수 없습니다 @@ -80,13 +80,13 @@ 로그 보내기 충돌 로그 보내기 스크린샷 보내기 - 버그 보고서 + 버그 보고하기 버그에 대해 설명해주세요. 무엇을 했나요? 어떤 일이 일어나길 바라고 한 건가요? 실제로는 어떤 일이 일어났나요? 가능하다면, 영어로 설명해주세요. 여기에 문제를 설명해주세요 버그 보고서를 보내는데 성공했습니다 버그 보고서를 보내는데 실패했습니다 (%s) - 등록하기 + 계정 만들기 로그인 로그아웃 홈서버 URL @@ -108,7 +108,7 @@ 영상 찍기 로그인 - 등록하기 + 계정 만들기 제출하기 건너뛰기 이메일이나 이용자 이름 @@ -117,4 +117,65 @@ 이용자 이름 이용자가 당신을 찾고 재설정 비밀번호를 보낼 수 있게 이메일 주소를 적어주세요. 이용자가 당신을 찾을 수 있게 계정에 전화번호를 추가해주세요. + Status.im 테마 + + 서비스 초기화 중 + 소리로 알림 + 소리 없이 알림 + + 구성원 정보 + 커뮤니티 정보 + 키 백업 + 키 백업하기 + 인증 기기 + + 키 백업이 끝나지 않았습니다, 기다려주세요… + 지금 로그아웃하면 암호화된 메세지가 사라집니다 + 키 백업하기 + 정말이세요\? + 백업 + 머물기 + 넘기기 + 완료 + 정말 로그아웃하시겠어요\? + 읽었다고 표시 + Riot이 주소록에 접근할 수 없게 되어 있습니다 + + %d 사람들 + + + 초대 + 커뮤니티 + 최근에 애플리케이션이 충돌한 것 같습니다. 충돌 보고서를 열까요\? + 읽기 + + 사용자 이름 + 음성 보내기 + + 스티커팩이 하나도 없습니다. +\n +\n뭐라도 추가할까요\? + + 로그인 화면으로 돌아가기 + 이메일 주소 + 이메일 주소 (선택) + 전화번호 + 전화번호 (선택) + 비밀번호 확인 + 새 비밀번호 확인 + 알맞지 않은 사용자 이름이나 비밀번호 + 비밀번호가 너무 짧아요 (최소 6자) + 유효한 이메일 주소가 아닌 것 같아요 + 유효한 전화번호가 아닌 것 같아요 + 비밀번호가 맞지 않아요 + 비밀번호를 잊어버리셨나요\? + 사용중인 사용자 이름입니다 + 홈서버: + 비밀번호를 초기화하려면, 계정에 이메일을 등록해야합니다: + 새 비밀번호를 입력해야합니다. + 비밀번호가 초기화되었습니다. +\n +\n모든 기기에서 로그아웃되고 알림도 가지 않을 거에요. 다시 알림을 받으려면, 각 기기에 다시 로그인하세요. + 모바일 + diff --git a/vector/src/main/res/values-sq/strings.xml b/vector/src/main/res/values-sq/strings.xml index 82f4423e86..57baf24679 100644 --- a/vector/src/main/res/values-sq/strings.xml +++ b/vector/src/main/res/values-sq/strings.xml @@ -1484,4 +1484,51 @@ Që të garantoni se s’ju shpëton gjë, thjesht mbajeni të aktivizuar mekani Ndodhi një gabim gjatë marrjes së të dhënave të besueshmërisë Ndodhi një gabim teksa merreshin të dhëna kopjeruajtjeje kyçesh + Mirë se vini në beta! + Teksa Riot X është në fillimet e zhvillimit, disa veçori mund të mos jenë gati dhe mund të hasni të meta. + Lista e veçorive më të reja gjendet te %1$s, dhe nëse gjeni të meta, ju lutemi, parashtroni një njoftim te menuja majtas sipër te Home, dhe do t’i ndreqim sa më shpejt të mundemi. + Përshkrim në Play Store + Nëse gjeni të meta, ju lutemi, parashtroni një njoftim te menuja majtas sipër te Home, dhe do t’i ndreqim sa më shpejt të mundemi. + + Importo kyçe e2e prej kartelës \"%1$s\". + + Versioni Matrix SDK + Shënime të tjera palësh të treta + Po e shihni tashmë këtë dhomë! + + Reagime të Shpejta + + Të përgjithshme + Parapëlqime + Siguri & Privatësi + Ekspert + Rregulla për Push + S’ka të përcaktuara rregulla për push + Pa kanale push të regjistruar + + Url: + Format: + + Zë & Video + Ndihmë & Mbi + + + Bëni një sugjerim + Ju lutemi, shkruajeni sugjerimin tuaj më poshtë. + Përshkruani këtu sugjerimin tuaj + Faleminderit, sugjerimi u dërgua me sukses + S’u arrit të dërgohej sugjerimi (%s) + + Shfaq te rrjedha kohore akte të fshehura + + RiotX - Klient Matrix i Brezit të Ardhshëm + Një klient më i shpejtë dhe më i lehtë për Matrix, që përdor mekanizmat më të rinj Android + RiotX është një klient i ri për protokollin Matrix (Matrix.org): një rrjet i hapur për komunikim të sigurt, të centralizuar. RiotX është një rishkrim i plotë i klientit Riot Android, bazuar në një rishkrim të plotë të Matrix Android SDK-së. +\n +\nKlauzolë: Ky është një version beta. RiotX-i është ende nën zhivillim aktiv dhe përmban kufizime dhe (shpresojmë të mos jenë shumë) të meta. Mirëpresim krejt përshtypjet dhe sugjerimet! +\n +\nRiotX-i mbulon: • Hyrje në një llogari ekzistuese • Krijim dhome dhe pjesëmarrje në dhoma publike • Pranim dhe hedhje poshtë ftesash • Njohje të dhomave të përdoruesve • Parje hollësish dhome • Dërgim mesazhesh tekst • Dërgim bashkëngjitjesh • Lexim dhe shkrim mesazhesh në dhoma të fshehtëzuara • Kriptografi: kopjeruajtje kyçesh E2E, verifikim i thelluar pajisjesh, kërkesa dhe përgjigje për ndarje kyçesh • Njoftime push • Tema të Çelëta, të Errëta dhe të Zeza +\n +\nNë RiotX s’janë sendërtuar ende krejt veçoritë e Riot-it. Veçori kryesore që mungojnë (dhe që do të vijnë së shpejti!): • Krijim llogarish • Rregullime dhome (shfaqje anëtarësh dhome, etj.) • Krijim dhomash fjalosjeje të drejtpërdrejtë • Thirrje • Widget-es • … + diff --git a/vector/src/main/res/values-zh-rTW/strings.xml b/vector/src/main/res/values-zh-rTW/strings.xml index a7152c10f3..cb06508b83 100644 --- a/vector/src/main/res/values-zh-rTW/strings.xml +++ b/vector/src/main/res/values-zh-rTW/strings.xml @@ -1479,4 +1479,57 @@ Matrix 中的消息可見度類似于電子郵件。我們忘記您的郵件意 取得信任資訊時發生錯誤 取得金鑰備份資料時發生錯誤 + 歡迎使用測試版! + Riot X 還在早期開發階段,可能會缺少某些功能,您可能會遇到臭蟲。 + 最新的功能清單一直都會在 %1$s,如果您發現臭蟲,請在首頁左上角的選單中遞交回報,我們將會盡快修復。 + Play 商店描述 + 如果您發現臭蟲,請在首頁左上角的選單中遞交回報,我們將會盡快修復。 + + 從檔案「%1$s」匯入 e2e 金鑰。 + + Matrix SDK 版本 + 其他第三方提醒 + 您已在檢視此聊天室了! + + 快速反應 + + 一般 + 偏好設定 + 安全與隱私 + 專家 + 推送規則 + 未定義通送規則 + 沒有已註冊的推送閘道 + + app_id: + push_key: + app_display_name: + device_name: + Url: + 格式: + + 音訊與視訊 + 說明與關於 + + + 註冊代符 + + 建議 + 請在下面編寫您的建議。 + 在此描述您的建議 + 感謝,建議已成功傳送 + 建議傳送失敗 (%s) + + 在時間軸中顯示隱藏的活動 + + RiotX - 下一代的 Matrix 客戶端 + 使用最新 Android 框架的 Matrix 較快且輕量的客戶端 + RiotX 是 Matrix 協定 (Matrix.org) 的新客戶端:安全、去中心化通訊的開放網路。RiotX 是 Riot Android 客戶端的完全重寫,以 Matrix Android SDK 的完全重寫為基礎。 +\n +\n免責聲明:這是測試版。RiotX 目前仍在積極開發中,包含限制與(我們希望不多的)臭蟲。所有的回饋都很歡迎! +\n +\nRiotX 支援:• 登入到既有的帳號 • 建立聊天室與加入公開聊天室 • 接受與回絕邀請 • 列出使用者聊天室 • 檢視聊天室詳細資訊 • 傳送文字訊息 • 傳送附件 • 讀取與編寫已加密的聊天室 • 加密:E2E 金鑰備份、進階裝置驗證、金鑰分享請求與回應 • 推送通知 • 亮、暗與黑色主題 +\n +\n不是所有 Riot 的功能都已在 RiotX 中實作。主要缺少(會在稍後到來!)的功能:• 建立帳號 • 聊天室設定(列出聊天室成員等) • 直接聊天室建立 • 通話 • 小工具 • … + diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 71672eb216..4c26e8ce0b 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -1534,6 +1534,7 @@ Why choose Riot.im? Other third party notices You are already viewing this room! + Quick Reactions General @@ -1593,4 +1594,38 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming • Widgets • …" + Direct Messages + + Waiting… + Encrypting thumbnail… + Sending thumbnail (%1$s / %2$s) + Encrypting file… + Sending file (%1$s / %2$s) + + Downloading file %1$s… + File %1$s has been downloaded! + + "(edited)" + + + %1$s to create an account. + Use the old app + + + Message Edits + No edits found + + + Filter conversations… + Can’t find what you’re looking for? + Create a new room + Send a new direct message + View the room directory + + Name or ID (#example:matrix.org) + + Enable swipe to reply in timeline + + Link copied to clipboard + diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index f6ec489276..118fde8442 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -3,40 +3,4 @@ - Direct Messages - - Waiting… - Encrypting thumbnail… - Sending thumbnail (%1$s / %2$s) - Encrypting file… - Sending file (%1$s / %2$s) - - Downloading file %1$s… - File %1$s has been downloaded! - - "(edited)" - - - %1$s to create an account. - Use the old app - - - - Message Edits - No edits found - - - Filter conversations… - Can’t find what you’re looking for? - Create a new room - Send a new direct message - View the room directory - - Name or ID (#example:matrix.org) - - - Enable swipe to reply in timeline - - Link copied to clipboard - \ No newline at end of file From f0671b9e7309a96dc31c744349a32a5626b16751 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 14:28:46 +0200 Subject: [PATCH 12/19] "Riot X" -> "RiotX" --- docs/notifications.md | 8 ++++---- vector/src/main/res/values-eu/strings.xml | 2 +- vector/src/main/res/values-fi/strings.xml | 2 +- vector/src/main/res/values-hu/strings.xml | 2 +- vector/src/main/res/values-it/strings.xml | 2 +- vector/src/main/res/values-sq/strings.xml | 2 +- vector/src/main/res/values-zh-rTW/strings.xml | 2 +- vector/src/main/res/values/strings.xml | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/notifications.md b/docs/notifications.md index 290a63a652..328eb86954 100644 --- a/docs/notifications.md +++ b/docs/notifications.md @@ -1,4 +1,4 @@ -This document aims to describe how Riot X android displays notifications to the end user. It also clarifies notifications and background settings in the app. +This document aims to describe how RiotX android displays notifications to the end user. It also clarifies notifications and background settings in the app. # Table of Contents 1. [Prerequisites Knowledge](#prerequisites-knowledge) @@ -50,7 +50,7 @@ By default, this is 0, so the server will return immediately even if the respons **delay** is a client preference. When the server responds to a sync request, the client waits for `delay`before calling a new sync. -When the Riot X Android app is open (i.e in foreground state), the default timeout is 30 seconds, and delay is 0. +When the RiotX Android app is open (i.e in foreground state), the default timeout is 30 seconds, and delay is 0. ## How does a mobile app receives push notification @@ -86,7 +86,7 @@ This need some disambiguation, because it is the source of common confusion: In order to send a push to a mobile, App developers need to have a server that will use the FCM APIs, and these APIs requires authentication! This server is called a **Push Gateway** in the matrix world -That means that Riot X Android, a matrix client created by New Vector, is using a **Push Gateway** with the needed credentials (FCM API secret Key) in order to send push to the New Vector client. +That means that RiotX Android, a matrix client created by New Vector, is using a **Push Gateway** with the needed credentials (FCM API secret Key) in order to send push to the New Vector client. If you create your own matrix client, you will also need to deploy an instance of a **Push Gateway** with the credentials needed to use FCM for your app. @@ -223,7 +223,7 @@ Upon reception of the FCM push, RiotX will perform a sync call to the Home Serve * The sync generates additional notifications (e.g an encrypted message where the user is mentioned detected locally) * The sync takes too long and the process is killed before completion, or network is not reliable and the sync fails. -Riot X implements several strategies in these cases (TODO document) +RiotX implements several strategies in these cases (TODO document) ## FCM Fallback mode diff --git a/vector/src/main/res/values-eu/strings.xml b/vector/src/main/res/values-eu/strings.xml index a3846d5d35..0736e1b83b 100644 --- a/vector/src/main/res/values-eu/strings.xml +++ b/vector/src/main/res/values-eu/strings.xml @@ -1523,7 +1523,7 @@ Abisua: Fitxategi hau ezabatu daiteke aplikazioa desinstalatzen bada. Errore bat gertatu da gakoen babes-kopiaren datuak jasotzean Ongi etorri betara! - Riot X oraindik garapenean dagoenez, ezaugarri batzuk faltan bota ditzakezu eta akatsen bat aurkitu dezakezu. + RiotX oraindik garapenean dagoenez, ezaugarri batzuk faltan bota ditzakezu eta akatsen bat aurkitu dezakezu. Azken ezaugarrien zerrenda hemen dago beti : %1$s, eta akatsak aurkitzen badituzu bidali mesedez akatsen txosten bat Hasiera pantailako goi ezkerreko menua erabiliz, eta ahalik eta lasterren konponduko dugu. Play Store-ko deskripzioa Akatsak aurkitzen badituzu bidali mesedez akatsen txosten bat Hasiera pantailako goi ezkerreko menua erabiliz, eta ahalik eta lasterren konponduko dugu. diff --git a/vector/src/main/res/values-fi/strings.xml b/vector/src/main/res/values-fi/strings.xml index 9e2418416d..8855311473 100644 --- a/vector/src/main/res/values-fi/strings.xml +++ b/vector/src/main/res/values-fi/strings.xml @@ -1526,7 +1526,7 @@ Jotta et menetä mitään, automaattiset päivitykset kannattaa pitää käytös \nJos et kirjautunut toisella laitteella, voit jättää tämän pyynnön huomiotta. Tervetuloa beetaan! - Riot X on varhaisessa kehitysvaiheessa, mistä johtuen osa ominaisuuksista puuttuu ja saatat kohdata virheitä. + RiotX on varhaisessa kehitysvaiheessa, mistä johtuen osa ominaisuuksista puuttuu ja saatat kohdata virheitä. Matrix SDK:n versio Muut kolmansien osapuolten huomautukset Pikareaktiot diff --git a/vector/src/main/res/values-hu/strings.xml b/vector/src/main/res/values-hu/strings.xml index 2f761b7ad4..035cae08e3 100644 --- a/vector/src/main/res/values-hu/strings.xml +++ b/vector/src/main/res/values-hu/strings.xml @@ -1527,7 +1527,7 @@ Ha nem te állítottad be a visszaállítási metódust, akkor egy támadó pró A kulcs mentés adatainak beszerzésekor hiba történt Üdv a béta verzióban! - Amíg a Riot X újdonsült fejlesztés, néhány funkció hiányozhat és találkozhatsz hibákkal. + Amíg a RiotX újdonsült fejlesztés, néhány funkció hiányozhat és találkozhatsz hibákkal. A legfrissebb funkciók listáját itt találod: %1$s, és ha hibát találsz kérlek küldj egy jelentést róla a Kezdő oldal bal felső sarkában lévő menüvel és ahogy tudjuk javítjuk. Play áruház leírás Ha hibát találsz kérlek küldj egy jelentést róla a Kezdő oldal bal felső sarkában lévő menüvel és ahogy tudjuk javítjuk. diff --git a/vector/src/main/res/values-it/strings.xml b/vector/src/main/res/values-it/strings.xml index c2971aeb7c..cb5141ce48 100644 --- a/vector/src/main/res/values-it/strings.xml +++ b/vector/src/main/res/values-it/strings.xml @@ -1571,7 +1571,7 @@ Per essere certo di non perdere nulla, mantieni gli aggiornamenti attivi."Si è verificato un errore nell\'ottenere i dati del backup chiavi Benvenuti nella beta! - Mentre Riot X si trova nella fase iniziale dello sviluppo, potrebbero mancare alcune funzioni e potrebbero verificarsi errori. + Mentre RiotX si trova nella fase iniziale dello sviluppo, potrebbero mancare alcune funzioni e potrebbero verificarsi errori. L\'elenco di funzioni più recenti è sempre nel %1$s, se trovi errori ti preghiamo segnalarli nel menu in alto a sinistra della Pagina Iniziale e noi li correggeremo appena possibile. Descrizione nel Play Store Se trovi errori ti preghiamo segnalarli nel menu in alto a sinistra della Pagina Iniziale e noi li correggeremo appena possibile. diff --git a/vector/src/main/res/values-sq/strings.xml b/vector/src/main/res/values-sq/strings.xml index 57baf24679..8ab796fc56 100644 --- a/vector/src/main/res/values-sq/strings.xml +++ b/vector/src/main/res/values-sq/strings.xml @@ -1485,7 +1485,7 @@ Që të garantoni se s’ju shpëton gjë, thjesht mbajeni të aktivizuar mekani Ndodhi një gabim teksa merreshin të dhëna kopjeruajtjeje kyçesh Mirë se vini në beta! - Teksa Riot X është në fillimet e zhvillimit, disa veçori mund të mos jenë gati dhe mund të hasni të meta. + Teksa RiotX është në fillimet e zhvillimit, disa veçori mund të mos jenë gati dhe mund të hasni të meta. Lista e veçorive më të reja gjendet te %1$s, dhe nëse gjeni të meta, ju lutemi, parashtroni një njoftim te menuja majtas sipër te Home, dhe do t’i ndreqim sa më shpejt të mundemi. Përshkrim në Play Store Nëse gjeni të meta, ju lutemi, parashtroni një njoftim te menuja majtas sipër te Home, dhe do t’i ndreqim sa më shpejt të mundemi. diff --git a/vector/src/main/res/values-zh-rTW/strings.xml b/vector/src/main/res/values-zh-rTW/strings.xml index cb06508b83..3f755c2037 100644 --- a/vector/src/main/res/values-zh-rTW/strings.xml +++ b/vector/src/main/res/values-zh-rTW/strings.xml @@ -1480,7 +1480,7 @@ Matrix 中的消息可見度類似于電子郵件。我們忘記您的郵件意 取得金鑰備份資料時發生錯誤 歡迎使用測試版! - Riot X 還在早期開發階段,可能會缺少某些功能,您可能會遇到臭蟲。 + RiotX 還在早期開發階段,可能會缺少某些功能,您可能會遇到臭蟲。 最新的功能清單一直都會在 %1$s,如果您發現臭蟲,請在首頁左上角的選單中遞交回報,我們將會盡快修復。 Play 商店描述 如果您發現臭蟲,請在首頁左上角的選單中遞交回報,我們將會盡快修復。 diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 4c26e8ce0b..daab4259e8 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -1522,7 +1522,7 @@ Why choose Riot.im? "An error occurred getting keys backup data" Welcome to the beta! - "While Riot X is in early development, some features may be missing and you may experience bugs." + "While RiotX is in early development, some features may be missing and you may experience bugs." "The latest feature list is always in the %1$s, and if you find bugs please submit a report in the top left menu of Home, and we’ll fix them as quickly as we can." "Play Store description" From d609c49b31333b450d7dac61f8ce1b1ddcf75281 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 17:47:24 +0200 Subject: [PATCH 13/19] Prepare release 0.2.0 --- CHANGES.md | 10 +--------- vector/build.gradle | 4 ++-- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7fcf6842cf..dfda3cef02 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -Changes in RiotX 0.2.1 (2019-XX-XX) +Changes in RiotX 0.2.0 (2019-07-18) =================================================== Features: @@ -23,14 +23,6 @@ Bugfix: - Fix bad layout for room directory filter (#349) - Fix Copying link from a message shouldn't open context menu (#364) -Translations: - - - -Build: - - - - - Changes in RiotX 0.1.0 (2019-07-11) =================================================== diff --git a/vector/build.gradle b/vector/build.gradle index 5fdb240a13..6a7a8e3a22 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -65,8 +65,8 @@ android { multiDexEnabled true // For release, use generateVersionCodeFromVersionName() - versionCode generateVersionCodeFromTimestamp() - // versionCode generateVersionCodeFromVersionName() + // versionCode generateVersionCodeFromTimestamp() + versionCode generateVersionCodeFromVersionName() versionName "${versionMajor}.${versionMinor}.${versionPatch}" From c3d945d6bba1692a9cacbdb9f33cbb75ebdd0a50 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 18 Jul 2019 17:48:56 +0200 Subject: [PATCH 14/19] Version++ --- CHANGES.md | 24 +++++++++++++++++++++++- vector/build.gradle | 8 ++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index dfda3cef02..ff2c81e18e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,25 @@ +Changes in RiotX 0.3.0 (2019-XX-XX) +=================================================== + +Features: + - + +Improvements: + - + +Other changes: + - + +Bugfix: + - + +Translations: + - + +Build: + - + + Changes in RiotX 0.2.0 (2019-07-18) =================================================== @@ -36,7 +58,7 @@ Mode details here: https://medium.com/@RiotChat/introducing-the-riotx-beta-for-a ======================================================= -Changes in RiotX 0.XX (2019-XX-XX) +Changes in RiotX 0.0.0 (2019-XX-XX) =================================================== Features: diff --git a/vector/build.gradle b/vector/build.gradle index 6a7a8e3a22..db9ad6d63a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -13,7 +13,7 @@ androidExtensions { } ext.versionMajor = 0 -ext.versionMinor = 2 +ext.versionMinor = 3 ext.versionPatch = 0 static def getGitTimestamp() { @@ -65,10 +65,10 @@ android { multiDexEnabled true // For release, use generateVersionCodeFromVersionName() - // versionCode generateVersionCodeFromTimestamp() - versionCode generateVersionCodeFromVersionName() + versionCode generateVersionCodeFromTimestamp() + //versionCode generateVersionCodeFromVersionName() - versionName "${versionMajor}.${versionMinor}.${versionPatch}" + versionName "${versionMajor}.${versionMinor}.${versionPatch}-dev" buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\"" resValue "string", "git_revision", "\"${gitRevision()}\"" From c00dbce536a90f162831e57ccb23fb5f499d0252 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 19 Jul 2019 09:57:57 +0200 Subject: [PATCH 15/19] Fix #390 (edited) string in edited message body --- CHANGES.md | 2 +- .../home/room/detail/timeline/factory/MessageItemFactory.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index ff2c81e18e..cc5689d4a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,7 +11,7 @@ Other changes: - Bugfix: - - + - Edited message: link confusion when (edited) appears in body (#398) Translations: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt index 3a0d2d1dc5..c330b85d35 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/timeline/factory/MessageItemFactory.kt @@ -323,7 +323,7 @@ class MessageItemFactory @Inject constructor( val editedSuffix = stringProvider.getString(R.string.edited_suffix) spannable.append(" ").append(editedSuffix) val color = colorProvider.getColorFromAttribute(R.attr.vctr_list_header_secondary_text_color) - val editStart = spannable.indexOf(editedSuffix) + val editStart = spannable.lastIndexOf(editedSuffix) val editEnd = editStart + editedSuffix.length spannable.setSpan( ForegroundColorSpan(color), From cd6624a8a6e499cd38768c4d9bbf12135d904fc8 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jul 2019 15:15:29 +0200 Subject: [PATCH 16/19] Fix issue on setting screen: bad alignment of title --- vector/src/main/res/layout/activity_vector_settings.xml | 4 +++- vector/src/main/res/values/styles_riot.xml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/vector/src/main/res/layout/activity_vector_settings.xml b/vector/src/main/res/layout/activity_vector_settings.xml index 55716157e1..eaba9b33d3 100755 --- a/vector/src/main/res/layout/activity_vector_settings.xml +++ b/vector/src/main/res/layout/activity_vector_settings.xml @@ -9,8 +9,10 @@ android:layout_height="match_parent" android:orientation="vertical"> + @@ -19,7 +21,7 @@ android:id="@+id/vector_settings_page" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?android:attr/colorBackground" /> + android:background="?riotx_background" /> diff --git a/vector/src/main/res/values/styles_riot.xml b/vector/src/main/res/values/styles_riot.xml index 91753271df..eaf0530b96 100644 --- a/vector/src/main/res/values/styles_riot.xml +++ b/vector/src/main/res/values/styles_riot.xml @@ -4,11 +4,14 @@ - + + From 10490e3aa629d86b4c425c05eaf861882de5c83e Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jul 2019 16:00:06 +0200 Subject: [PATCH 17/19] Close detail room screen when the room is left with another client (#256) --- CHANGES.md | 1 + .../features/home/room/detail/RoomDetailFragment.kt | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index cc5689d4a6..50cbb3e15c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Other changes: Bugfix: - Edited message: link confusion when (edited) appears in body (#398) + - Close detail room screen when the room is left with another client (#256) Translations: - diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index b7491ae6b2..1ff2c67dc1 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -536,9 +536,14 @@ class RoomDetailFragment : private fun renderRoomSummary(state: RoomDetailViewState) { state.asyncRoomSummary()?.let { - roomToolbarTitleView.text = it.displayName - avatarRenderer.render(it, roomToolbarAvatarImageView) - roomToolbarSubtitleView.setTextOrHide(it.topic) + if (it.membership.isLeft()) { + Timber.w("The room has been left") + activity?.finish() + } else { + roomToolbarTitleView.text = it.displayName + avatarRenderer.render(it, roomToolbarAvatarImageView) + roomToolbarSubtitleView.setTextOrHide(it.topic) + } } } From 1a4ec34bb284db2d4bb7bf32e1862690b2118f5b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jul 2019 16:03:37 +0200 Subject: [PATCH 18/19] Code cleanup --- .../settings/VectorSettingsActivity.kt | 39 +++++++++---------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt index 5db218c3e4..fcf7efa426 100755 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsActivity.kt @@ -17,7 +17,6 @@ package im.vector.riotx.features.settings import android.content.Context import android.content.Intent -import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentManager import androidx.preference.Preference import androidx.preference.PreferenceFragmentCompat @@ -75,32 +74,30 @@ class VectorSettingsActivity : VectorBaseActivity(), } } - override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat?, pref: Preference?): Boolean { - var oFragment: Fragment? = null - - if (VectorPreferences.SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY == pref?.key) { - oFragment = VectorSettingsNotificationsTroubleshootFragment.newInstance(session.myUserId) - } else if (VectorPreferences.SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY == pref?.key) { - oFragment = VectorSettingsAdvancedNotificationPreferenceFragment.newInstance(session.myUserId) - } else { - try { - pref?.fragment?.let { - oFragment = supportFragmentManager.fragmentFactory - .instantiate(classLoader, it) + override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat, pref: Preference): Boolean { + val oFragment = when { + VectorPreferences.SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY == pref.key -> + VectorSettingsNotificationsTroubleshootFragment.newInstance(session.myUserId) + VectorPreferences.SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY == pref.key -> + VectorSettingsAdvancedNotificationPreferenceFragment.newInstance(session.myUserId) + else -> + try { + pref.fragment?.let { + supportFragmentManager.fragmentFactory.instantiate(classLoader, it) + } + } catch (e: Throwable) { + showSnackbar(getString(R.string.not_implemented)) + Timber.e(e) + null } - } catch (e: Throwable) { - showSnackbar(getString(R.string.not_implemented)) - Timber.e(e) - } } if (oFragment != null) { - oFragment!!.setTargetFragment(caller, 0) + oFragment.setTargetFragment(caller, 0) // Replace the existing Fragment with the new Fragment supportFragmentManager.beginTransaction() - .setCustomAnimations(R.anim.right_in, R.anim.fade_out, - R.anim.fade_in, R.anim.right_out) - .replace(R.id.vector_settings_page, oFragment!!, pref?.title.toString()) + .setCustomAnimations(R.anim.right_in, R.anim.fade_out, R.anim.fade_in, R.anim.right_out) + .replace(R.id.vector_settings_page, oFragment, pref.title.toString()) .addToBackStack(null) .commit() return true From 6d01a570fdcec11387614bb02612c81a4f149a7c Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 19 Jul 2019 16:44:30 +0200 Subject: [PATCH 19/19] Clear notification for a room left on another client --- CHANGES.md | 1 + .../android/api/pushrules/PushRuleService.kt | 1 + .../session/notification/DefaultPushRuleService.kt | 14 +++++++++++--- .../notification/ProcessEventForPushTask.kt | 4 ++++ .../notifications/PushRuleTriggerListener.kt | 4 ++++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 50cbb3e15c..1ba5b11ebd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,6 +13,7 @@ Other changes: Bugfix: - Edited message: link confusion when (edited) appears in body (#398) - Close detail room screen when the room is left with another client (#256) + - Clear notification for a room left on another client Translations: - diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/PushRuleService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/PushRuleService.kt index b00450b561..1fc37cd467 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/PushRuleService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/pushrules/PushRuleService.kt @@ -41,6 +41,7 @@ interface PushRuleService { interface PushRuleListener { fun onMatchRule(event: Event, actions: List) + fun onRoomLeft(roomId: String) fun batchFinish() } } \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/DefaultPushRuleService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/DefaultPushRuleService.kt index 5b21f0e562..7397f0eefb 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/DefaultPushRuleService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/DefaultPushRuleService.kt @@ -20,12 +20,10 @@ import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.auth.data.SessionParams import im.vector.matrix.android.api.pushrules.Action import im.vector.matrix.android.api.pushrules.PushRuleService -import im.vector.matrix.android.api.pushrules.rest.GetPushRulesResponse import im.vector.matrix.android.api.pushrules.rest.PushRule import im.vector.matrix.android.api.session.events.model.Event import im.vector.matrix.android.internal.database.mapper.PushRulesMapper import im.vector.matrix.android.internal.database.model.PushRulesEntity -import im.vector.matrix.android.internal.database.model.PusherEntityFields import im.vector.matrix.android.internal.database.query.where import im.vector.matrix.android.internal.session.SessionScope import im.vector.matrix.android.internal.session.pushers.GetPushRulesTask @@ -122,13 +120,23 @@ internal class DefaultPushRuleService @Inject constructor( } } + fun dispatchRoomLeft(roomid: String) { + try { + listeners.forEach { + it.onRoomLeft(roomid) + } + } catch (e: Throwable) { + Timber.e(e, "Error while dispatching room left") + } + } + fun dispatchFinish() { try { listeners.forEach { it.batchFinish() } } catch (e: Throwable) { - + Timber.e(e, "Error while dispatching finish") } } } \ No newline at end of file diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/ProcessEventForPushTask.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/ProcessEventForPushTask.kt index fc6c88384b..d196e563fe 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/ProcessEventForPushTask.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/session/notification/ProcessEventForPushTask.kt @@ -44,6 +44,10 @@ internal class DefaultProcessEventForPushTask @Inject constructor( override suspend fun execute(params: ProcessEventForPushTask.Params): Try { return Try { + // Handle left rooms + params.syncResponse.leave.keys.forEach { + defaultPushRuleService.dispatchRoomLeft(it) + } val newJoinEvents = params.syncResponse.join .map { entries -> entries.value.timeline?.events?.map { it.copy(roomId = entries.key) } diff --git a/vector/src/main/java/im/vector/riotx/features/notifications/PushRuleTriggerListener.kt b/vector/src/main/java/im/vector/riotx/features/notifications/PushRuleTriggerListener.kt index 760128dee1..d404b64c1e 100644 --- a/vector/src/main/java/im/vector/riotx/features/notifications/PushRuleTriggerListener.kt +++ b/vector/src/main/java/im/vector/riotx/features/notifications/PushRuleTriggerListener.kt @@ -56,6 +56,10 @@ class PushRuleTriggerListener @Inject constructor( } } + override fun onRoomLeft(roomId: String) { + notificationDrawerManager.clearMessageEventOfRoom(roomId) + } + override fun batchFinish() { notificationDrawerManager.refreshNotificationDrawer() }