mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-02-05 21:43:40 +01:00
Improve computation of the work name to limit its length
This commit is contained in:
parent
8864a3cf2c
commit
791d4fb1e8
@ -20,6 +20,7 @@ import android.content.Context
|
||||
import androidx.work.WorkerParameters
|
||||
import com.squareup.moshi.JsonClass
|
||||
import io.realm.RealmConfiguration
|
||||
import org.matrix.android.sdk.api.util.md5
|
||||
import org.matrix.android.sdk.internal.SessionManager
|
||||
import org.matrix.android.sdk.internal.database.awaitTransaction
|
||||
import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationShareAggregatedSummaryEntity
|
||||
@ -88,8 +89,9 @@ internal class DeactivateLiveLocationShareWorker(context: Context, params: Worke
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val WORK_NAME_PREFIX = "DeactivateLiveLocationWork-"
|
||||
|
||||
fun getWorkName(eventId: String, roomId: String) = "${WORK_NAME_PREFIX}$eventId-$roomId"
|
||||
fun getWorkName(eventId: String, roomId: String): String {
|
||||
val hash = "$eventId$roomId".md5()
|
||||
return "DeactivateLiveLocationWork-$hash"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user