mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-22 13:48:52 +01:00
Migrate old SIA preference
This commit is contained in:
@@ -24,6 +24,14 @@ class BlockingManager @Inject constructor(
|
|||||||
else -> qkBlockingClient
|
else -> qkBlockingClient
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
// Migrate from old SIA preference to blocking manager preference
|
||||||
|
if (prefs.sia.get()) {
|
||||||
|
prefs.blockingManager.set(Preferences.BLOCKING_MANAGER_SIA)
|
||||||
|
prefs.sia.delete()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun isBlocked(address: String): Single<Boolean> = client.isBlocked(address)
|
override fun isBlocked(address: String): Single<Boolean> = client.isBlocked(address)
|
||||||
|
|
||||||
override fun canBlock(): Boolean = client.canBlock()
|
override fun canBlock(): Boolean = client.canBlock()
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ class Preferences @Inject constructor(private val rxPrefs: RxSharedPreferences)
|
|||||||
val black = rxPrefs.getBoolean("black", false)
|
val black = rxPrefs.getBoolean("black", false)
|
||||||
val systemFont = rxPrefs.getBoolean("systemFont", false)
|
val systemFont = rxPrefs.getBoolean("systemFont", false)
|
||||||
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
val textSize = rxPrefs.getInteger("textSize", TEXT_SIZE_NORMAL)
|
||||||
|
@Deprecated("This should only be accessed when migrating to @blockingManager")
|
||||||
|
val sia = rxPrefs.getBoolean("sia", false)
|
||||||
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
val blockingManager = rxPrefs.getInteger("blockingManager", BLOCKING_MANAGER_QKSMS)
|
||||||
val drop = rxPrefs.getBoolean("drop", false)
|
val drop = rxPrefs.getBoolean("drop", false)
|
||||||
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
val notifAction1 = rxPrefs.getInteger("notifAction1", NOTIFICATION_ACTION_READ)
|
||||||
|
|||||||
Reference in New Issue
Block a user