mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
Make member ordering consistent
This commit is contained in:
parent
ed87961850
commit
2441d86b32
@ -5,34 +5,31 @@ import org.session.libsession.messaging.utilities.Data
|
||||
import org.session.libsession.utilities.TextSecurePreferences
|
||||
|
||||
class TrimThreadJob(val threadId: Long) : Job {
|
||||
companion object {
|
||||
const val KEY: String = "TrimThreadJob"
|
||||
|
||||
const val THREAD_ID = "thread_id"
|
||||
}
|
||||
|
||||
override var delegate: JobDelegate? = null
|
||||
override var id: String? = null
|
||||
override var failureCount: Int = 0
|
||||
|
||||
override val maxFailureCount: Int = 1
|
||||
|
||||
companion object {
|
||||
const val KEY: String = "TrimThreadJob"
|
||||
const val THREAD_ID = "thread_id"
|
||||
}
|
||||
|
||||
override fun execute() {
|
||||
val context = MessagingModuleConfiguration.shared.context
|
||||
val trimmingEnabled = TextSecurePreferences.isThreadLengthTrimmingEnabled(context)
|
||||
val threadLengthLimit = TextSecurePreferences.getThreadTrimLength(context)
|
||||
|
||||
if (trimmingEnabled) {
|
||||
MessagingModuleConfiguration.shared.storage.trimThread(threadId, threadLengthLimit)
|
||||
}
|
||||
|
||||
delegate?.handleJobSucceeded(this)
|
||||
}
|
||||
|
||||
override fun serialize(): Data {
|
||||
return Data.Builder()
|
||||
.putLong(THREAD_ID, threadId)
|
||||
.build()
|
||||
.putLong(THREAD_ID, threadId)
|
||||
.build()
|
||||
}
|
||||
|
||||
override fun getFactoryKey(): String = "TrimThreadJob"
|
||||
|
Loading…
x
Reference in New Issue
Block a user