Use named arguments for clarity
This commit is contained in:
parent
b090cb6b4b
commit
52d0b826f4
|
@ -52,7 +52,11 @@ internal class DefaultRedactEventTask @Inject constructor(
|
||||||
txId = params.txID,
|
txId = params.txID,
|
||||||
roomId = params.roomId,
|
roomId = params.roomId,
|
||||||
eventId = params.eventId,
|
eventId = params.eventId,
|
||||||
body = EventRedactBody(params.reason, withRelations, withRelations)
|
body = EventRedactBody(
|
||||||
|
reason = params.reason,
|
||||||
|
withRelations = withRelations,
|
||||||
|
withRelationsUnstable = withRelations,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return response.eventId
|
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 {
|
fun createRedactEvent(roomId: String, eventId: String, reason: String?, withRelations: List<String>? = null, additionalContent: Content? = null): Event {
|
||||||
val localId = LocalEcho.createLocalEchoId()
|
val localId = LocalEcho.createLocalEchoId()
|
||||||
val content = if (reason != null || withRelations != null) {
|
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 {
|
} else {
|
||||||
additionalContent
|
additionalContent
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,10 +69,14 @@ internal class RedactEventWorker(context: Context, params: WorkerParameters, ses
|
||||||
return runCatching {
|
return runCatching {
|
||||||
executeRequest(globalErrorReceiver) {
|
executeRequest(globalErrorReceiver) {
|
||||||
roomAPI.redactEvent(
|
roomAPI.redactEvent(
|
||||||
params.txID,
|
txId = params.txID,
|
||||||
params.roomId,
|
roomId = params.roomId,
|
||||||
eventId,
|
eventId = eventId,
|
||||||
EventRedactBody(params.reason, withRelations, withRelations)
|
body = EventRedactBody(
|
||||||
|
reason = params.reason,
|
||||||
|
withRelations = withRelations,
|
||||||
|
withRelationsUnstable = withRelations,
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}.fold(
|
}.fold(
|
||||||
|
|
Loading…
Reference in New Issue