Javadoc for NoMerger

This commit is contained in:
Benoit Marty 2019-08-05 16:40:18 +02:00
parent f910cd6f97
commit 4deb7eb865
2 changed files with 6 additions and 3 deletions

View File

@ -278,7 +278,7 @@ internal class DefaultSendService @Inject constructor(private val context: Conte
return "${roomId}_$identifier"
}
private fun createEncryptEventWork(event: Event, startChain: Boolean = false): OneTimeWorkRequest {
private fun createEncryptEventWork(event: Event, startChain: Boolean): OneTimeWorkRequest {
// Same parameter
val params = EncryptEventWorker.Params(credentials.userId, roomId, event)
val sendWorkData = WorkerParamsFactory.toData(params)
@ -314,7 +314,7 @@ internal class DefaultSendService @Inject constructor(private val context: Conte
private fun createUploadMediaWork(event: Event,
attachment: ContentAttachmentData,
isRoomEncrypted: Boolean,
startChain: Boolean = false): OneTimeWorkRequest {
startChain: Boolean): OneTimeWorkRequest {
val uploadMediaWorkerParams = UploadContentWorker.Params(credentials.userId, roomId, event, attachment, isRoomEncrypted)
val uploadWorkData = WorkerParamsFactory.toData(uploadMediaWorkerParams)

View File

@ -18,7 +18,10 @@ package im.vector.matrix.android.internal.session.room.send
import androidx.work.Data
import androidx.work.InputMerger
class NoMerger : InputMerger() {
/**
* InputMerger which takes only the first input, to ensure an appended work with only have the specified parameters
*/
internal class NoMerger : InputMerger() {
override fun merge(inputs: MutableList<Data>): Data {
return inputs.first()
}