commit 862e1a441a30093c0c80d325ee6b54704cf262e4
parent 0e4667603a5130185f34222914bf719b0f23dd93
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Fri, 19 Apr 2024 00:56:01 +0200
fix(core): relationship notifier init
Diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/FriendMutationObserver.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/features/impl/FriendMutationObserver.kt
@@ -17,15 +17,17 @@ class FriendMutationObserver: Feature("FriendMutationObserver", loadParams = Fea
private val translation by lazy { context.translation.getCategory("friend_mutation_observer") }
private val addSourceCache = EvictingMap<String, String>(500)
- private val notificationManager get() = context.androidContext.getSystemService(NotificationManager::class.java)
- private val channelId = "friend_mutation_observer".also {
- notificationManager.createNotificationChannel(
- NotificationChannel(
- it,
- translation["notification_channel_name"],
- NotificationManager.IMPORTANCE_HIGH
+ private val notificationManager by lazy { context.androidContext.getSystemService(NotificationManager::class.java) }
+ private val channelId by lazy {
+ "friend_mutation_observer".also {
+ notificationManager.createNotificationChannel(
+ NotificationChannel(
+ it,
+ translation["notification_channel_name"],
+ NotificationManager.IMPORTANCE_HIGH
+ )
)
- )
+ }
}
fun getFriendAddSource(userId: String): String? {