mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-19 04:38:44 +03:00
Use named arguments for clarity
This commit is contained in:
parent
b090cb6b4b
commit
52d0b826f4
3 changed files with 18 additions and 6 deletions
|
@ -52,7 +52,11 @@ internal class DefaultRedactEventTask @Inject constructor(
|
|||
txId = params.txID,
|
||||
roomId = params.roomId,
|
||||
eventId = params.eventId,
|
||||
body = EventRedactBody(params.reason, withRelations, withRelations)
|
||||
body = EventRedactBody(
|
||||
reason = params.reason,
|
||||
withRelations = withRelations,
|
||||
withRelationsUnstable = withRelations,
|
||||
)
|
||||
)
|
||||
}
|
||||
return response.eventId
|
||||
|
|
|
@ -799,7 +799,11 @@ internal class LocalEchoEventFactory @Inject constructor(
|
|||
fun createRedactEvent(roomId: String, eventId: String, reason: String?, withRelations: List<String>? = null, additionalContent: Content? = null): Event {
|
||||
val localId = LocalEcho.createLocalEchoId()
|
||||
val content = if (reason != null || withRelations != null) {
|
||||
EventRedactBody(reason, withRelations, withRelations).toContent().plus(additionalContent.orEmpty())
|
||||
EventRedactBody(
|
||||
reason = reason,
|
||||
withRelations = withRelations,
|
||||
withRelationsUnstable = withRelations,
|
||||
).toContent().plus(additionalContent.orEmpty())
|
||||
} else {
|
||||
additionalContent
|
||||
}
|
||||
|
|
|
@ -69,10 +69,14 @@ internal class RedactEventWorker(context: Context, params: WorkerParameters, ses
|
|||
return runCatching {
|
||||
executeRequest(globalErrorReceiver) {
|
||||
roomAPI.redactEvent(
|
||||
params.txID,
|
||||
params.roomId,
|
||||
eventId,
|
||||
EventRedactBody(params.reason, withRelations, withRelations)
|
||||
txId = params.txID,
|
||||
roomId = params.roomId,
|
||||
eventId = eventId,
|
||||
body = EventRedactBody(
|
||||
reason = params.reason,
|
||||
withRelations = withRelations,
|
||||
withRelationsUnstable = withRelations,
|
||||
)
|
||||
)
|
||||
}
|
||||
}.fold(
|
||||
|
|
Loading…
Add table
Reference in a new issue