Sets up default reactions to be Rocket, Hugs, Watching and Laghuing
This commit is contained in:
@@ -8,6 +8,8 @@ import androidx.compose.runtime.Immutable
|
|||||||
import com.fasterxml.jackson.module.kotlin.readValue
|
import com.fasterxml.jackson.module.kotlin.readValue
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
import com.vitorpamplona.amethyst.model.Account
|
||||||
import com.vitorpamplona.amethyst.model.ConnectivityType
|
import com.vitorpamplona.amethyst.model.ConnectivityType
|
||||||
|
import com.vitorpamplona.amethyst.model.DefaultReactions
|
||||||
|
import com.vitorpamplona.amethyst.model.DefaultZapAmounts
|
||||||
import com.vitorpamplona.amethyst.model.GLOBAL_FOLLOWS
|
import com.vitorpamplona.amethyst.model.GLOBAL_FOLLOWS
|
||||||
import com.vitorpamplona.amethyst.model.KIND3_FOLLOWS
|
import com.vitorpamplona.amethyst.model.KIND3_FOLLOWS
|
||||||
import com.vitorpamplona.amethyst.model.Nip47URI
|
import com.vitorpamplona.amethyst.model.Nip47URI
|
||||||
@@ -323,11 +325,11 @@ object LocalPreferences {
|
|||||||
|
|
||||||
val zapAmountChoices = getString(PrefKeys.ZAP_AMOUNTS, "[]")?.let {
|
val zapAmountChoices = getString(PrefKeys.ZAP_AMOUNTS, "[]")?.let {
|
||||||
Event.mapper.readValue<List<Long>?>(it)
|
Event.mapper.readValue<List<Long>?>(it)
|
||||||
}?.ifEmpty { listOf(500L, 1000L, 5000L) } ?: listOf(500L, 1000L, 5000L)
|
}?.ifEmpty { DefaultZapAmounts } ?: DefaultZapAmounts
|
||||||
|
|
||||||
val reactionChoices = getString(PrefKeys.REACTION_CHOICES, "[]")?.let {
|
val reactionChoices = getString(PrefKeys.REACTION_CHOICES, "[]")?.let {
|
||||||
Event.mapper.readValue<List<String>?>(it)
|
Event.mapper.readValue<List<String>?>(it)
|
||||||
}?.ifEmpty { listOf("+") } ?: listOf("+")
|
}?.ifEmpty { DefaultReactions } ?: DefaultReactions
|
||||||
|
|
||||||
val defaultZapType = getString(PrefKeys.DEFAULT_ZAPTYPE, "")?.let { serverName ->
|
val defaultZapType = getString(PrefKeys.DEFAULT_ZAPTYPE, "")?.let { serverName ->
|
||||||
LnZapEvent.ZapType.values().firstOrNull() { it.name == serverName }
|
LnZapEvent.ZapType.values().firstOrNull() { it.name == serverName }
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ val DefaultChannels = setOf(
|
|||||||
"42224859763652914db53052103f0b744df79dfc4efef7e950fc0802fc3df3c5" // -> Amethyst's Group
|
"42224859763652914db53052103f0b744df79dfc4efef7e950fc0802fc3df3c5" // -> Amethyst's Group
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val DefaultReactions = listOf("\uD83D\uDE80", "\uD83E\uDEC2", "\uD83D\uDC40", "\uD83D\uDE02")
|
||||||
|
|
||||||
|
val DefaultZapAmounts = listOf(500L, 1000L, 5000L)
|
||||||
|
|
||||||
fun getLanguagesSpokenByUser(): Set<String> {
|
fun getLanguagesSpokenByUser(): Set<String> {
|
||||||
val languageList = ConfigurationCompat.getLocales(Resources.getSystem().getConfiguration())
|
val languageList = ConfigurationCompat.getLocales(Resources.getSystem().getConfiguration())
|
||||||
val codedList = mutableSetOf<String>()
|
val codedList = mutableSetOf<String>()
|
||||||
@@ -67,8 +71,8 @@ class Account(
|
|||||||
var dontTranslateFrom: Set<String> = getLanguagesSpokenByUser(),
|
var dontTranslateFrom: Set<String> = getLanguagesSpokenByUser(),
|
||||||
var languagePreferences: Map<String, String> = mapOf(),
|
var languagePreferences: Map<String, String> = mapOf(),
|
||||||
var translateTo: String = Locale.getDefault().language,
|
var translateTo: String = Locale.getDefault().language,
|
||||||
var zapAmountChoices: List<Long> = listOf(500L, 1000L, 5000L),
|
var zapAmountChoices: List<Long> = DefaultZapAmounts,
|
||||||
var reactionChoices: List<String> = listOf("+"),
|
var reactionChoices: List<String> = DefaultReactions,
|
||||||
var defaultZapType: LnZapEvent.ZapType = LnZapEvent.ZapType.PRIVATE,
|
var defaultZapType: LnZapEvent.ZapType = LnZapEvent.ZapType.PRIVATE,
|
||||||
var defaultFileServer: ServersAvailable = ServersAvailable.NOSTR_BUILD,
|
var defaultFileServer: ServersAvailable = ServersAvailable.NOSTR_BUILD,
|
||||||
var defaultHomeFollowList: String = KIND3_FOLLOWS,
|
var defaultHomeFollowList: String = KIND3_FOLLOWS,
|
||||||
|
|||||||
Reference in New Issue
Block a user