Block user on the murena channel

This commit is contained in:
Jonathan Klee 2024-07-03 15:03:03 +02:00 committed by althafvly
parent 3e28ee2722
commit a9fa4fa0bf
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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