From a9fa4fa0bfd36020202c8d9aeac5cfea18fcfc00 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Wed, 3 Jul 2024 15:03:03 +0200 Subject: [PATCH] Block user on the murena channel --- app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt | 3 +-- app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt index bdc717b..4d15463 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/DetailActivity.kt @@ -76,8 +76,7 @@ class DetailActivity : AppCompatActivity(), ActionMode.Callback, NotificationFra notifier = NotificationService(this) appBaseUrl = getString(R.string.app_base_url) - // Show 'Back' button - supportActionBar?.setDisplayHomeAsUpEnabled(true) + supportActionBar?.setDisplayHomeAsUpEnabled(false) // Handle direct deep links to topic "ntfy://..." val url = intent?.data diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt index b44acab..aa3bef6 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -207,6 +207,7 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback, AddFragment.Subsc val defaultTopic = TOPIC_MURENA val hasTestTopic = subscriptions.any { it.topic == defaultTopic } if (hasTestTopic) { + showMurenaSub() return@launch } @@ -230,9 +231,14 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback, AddFragment.Subsc lastActive = Date().time / 1000 ) viewModel.add(subscription) + showMurenaSub() } } + private suspend fun showMurenaSub() { + startDetailView(repository.getSubscriptions().find { it.topic == "murena_notification" }!!) + } + private fun maybeRequestNotificationPermission() { // Android 13 (SDK 33) requires that we ask for permission to post notifications // https://developer.android.com/develop/ui/views/notifications/notification-permission