-
Notifications
You must be signed in to change notification settings - Fork 755
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2235 from vector-im/feature/bca/perf_better_send_…
…time Feature/bca/perf better send time
- Loading branch information
Showing
34 changed files
with
995 additions
and
528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ Features ✨: | |
- | ||
|
||
Improvements 🙌: | ||
- | ||
- Rework sending Event management (#154) | ||
|
||
Bugfix 🐛: | ||
- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/tasks/RedactEventTask.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Copyright 2020 The Matrix.org Foundation C.I.C. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.matrix.android.sdk.internal.crypto.tasks | ||
|
||
import org.greenrobot.eventbus.EventBus | ||
import org.matrix.android.sdk.internal.network.executeRequest | ||
import org.matrix.android.sdk.internal.session.room.RoomAPI | ||
import org.matrix.android.sdk.internal.session.room.send.SendResponse | ||
import org.matrix.android.sdk.internal.task.Task | ||
import javax.inject.Inject | ||
|
||
internal interface RedactEventTask : Task<RedactEventTask.Params, String> { | ||
data class Params( | ||
val txID: String, | ||
val roomId: String, | ||
val eventId: String, | ||
val reason: String? | ||
) | ||
} | ||
|
||
internal class DefaultRedactEventTask @Inject constructor( | ||
private val roomAPI: RoomAPI, | ||
private val eventBus: EventBus) : RedactEventTask { | ||
|
||
override suspend fun execute(params: RedactEventTask.Params): String { | ||
val executeRequest = executeRequest<SendResponse>(eventBus) { | ||
apiCall = roomAPI.redactEvent( | ||
txId = params.txID, | ||
roomId = params.roomId, | ||
eventId = params.eventId, | ||
reason = if (params.reason == null) emptyMap() else mapOf("reason" to params.reason) | ||
) | ||
} | ||
return executeRequest.eventId | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.