Loading app/src/main/java/io/heckel/ntfy/app/Application.kt +0 −1 Original line number Diff line number Diff line package io.heckel.ntfy.app import android.app.Application import android.content.Context import io.heckel.ntfy.db.Database import io.heckel.ntfy.db.Repository import io.heckel.ntfy.util.Log Loading app/src/main/java/io/heckel/ntfy/msg/ApiService.kt +2 −2 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ class ApiService { throw Exception("Unexpected response ${response.code} when polling topic $url") } val body = response.body?.string()?.trim() if (body == null || body.isEmpty()) return emptyList() if (body.isNullOrEmpty()) return emptyList() val notifications = body.lines().mapNotNull { line -> parser.parse(line, subscriptionId = subscriptionId, notificationId = 0) // No notification when we poll } Loading Loading @@ -166,7 +166,7 @@ class ApiService { } class UnauthorizedException(val user: User?) : Exception() class EntityTooLargeException() : Exception() class EntityTooLargeException : Exception() companion object { val USER_AGENT = "ntfy/${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}; Android ${Build.VERSION.RELEASE}; SDK ${Build.VERSION.SDK_INT})" Loading app/src/main/java/io/heckel/ntfy/msg/DownloadManager.kt +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import io.heckel.ntfy.util.Log * Download attachment in the background via WorkManager * * The indirection via WorkManager is required since this code may be executed * in a doze state and Internet may not be available. It's also best practice apparently. * in a doze state and Internet may not be available. It's also best practice, apparently. */ object DownloadManager { private const val TAG = "NtfyDownloadManager" Loading app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ class SubscriberService : Service() { // retrieve old messages. This is important, so we don't download attachments from old messages. val since = sinceByBaseUrl[connectionId.baseUrl] ?: "none" val serviceActive = { -> isServiceStarted } val serviceActive = { isServiceStarted } val user = repository.getUser(connectionId.baseUrl) val connection = if (repository.getConnectionProtocol() == Repository.CONNECTION_PROTOCOL_WS) { val alarmManager = getSystemService(ALARM_SERVICE) as AlarmManager Loading app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt +0 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,6 @@ import android.app.AlertDialog import android.app.Dialog import android.content.Context import android.os.Bundle import android.text.Editable import android.text.TextWatcher import android.view.View import android.view.WindowManager import android.view.inputmethod.InputMethodManager Loading Loading
app/src/main/java/io/heckel/ntfy/app/Application.kt +0 −1 Original line number Diff line number Diff line package io.heckel.ntfy.app import android.app.Application import android.content.Context import io.heckel.ntfy.db.Database import io.heckel.ntfy.db.Repository import io.heckel.ntfy.util.Log Loading
app/src/main/java/io/heckel/ntfy/msg/ApiService.kt +2 −2 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ class ApiService { throw Exception("Unexpected response ${response.code} when polling topic $url") } val body = response.body?.string()?.trim() if (body == null || body.isEmpty()) return emptyList() if (body.isNullOrEmpty()) return emptyList() val notifications = body.lines().mapNotNull { line -> parser.parse(line, subscriptionId = subscriptionId, notificationId = 0) // No notification when we poll } Loading Loading @@ -166,7 +166,7 @@ class ApiService { } class UnauthorizedException(val user: User?) : Exception() class EntityTooLargeException() : Exception() class EntityTooLargeException : Exception() companion object { val USER_AGENT = "ntfy/${BuildConfig.VERSION_NAME} (${BuildConfig.FLAVOR}; Android ${Build.VERSION.RELEASE}; SDK ${Build.VERSION.SDK_INT})" Loading
app/src/main/java/io/heckel/ntfy/msg/DownloadManager.kt +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ import io.heckel.ntfy.util.Log * Download attachment in the background via WorkManager * * The indirection via WorkManager is required since this code may be executed * in a doze state and Internet may not be available. It's also best practice apparently. * in a doze state and Internet may not be available. It's also best practice, apparently. */ object DownloadManager { private const val TAG = "NtfyDownloadManager" Loading
app/src/main/java/io/heckel/ntfy/service/SubscriberService.kt +1 −1 Original line number Diff line number Diff line Loading @@ -200,7 +200,7 @@ class SubscriberService : Service() { // retrieve old messages. This is important, so we don't download attachments from old messages. val since = sinceByBaseUrl[connectionId.baseUrl] ?: "none" val serviceActive = { -> isServiceStarted } val serviceActive = { isServiceStarted } val user = repository.getUser(connectionId.baseUrl) val connection = if (repository.getConnectionProtocol() == Repository.CONNECTION_PROTOCOL_WS) { val alarmManager = getSystemService(ALARM_SERVICE) as AlarmManager Loading
app/src/main/java/io/heckel/ntfy/ui/AddFragment.kt +0 −2 Original line number Diff line number Diff line Loading @@ -5,8 +5,6 @@ import android.app.AlertDialog import android.app.Dialog import android.content.Context import android.os.Bundle import android.text.Editable import android.text.TextWatcher import android.view.View import android.view.WindowManager import android.view.inputmethod.InputMethodManager Loading