Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 314bba41 authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Some style fixes

parent e64cd79c
Loading
Loading
Loading
Loading
+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
+2 −2
Original line number Diff line number Diff line
@@ -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
            }
@@ -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})"
+1 −1
Original line number Diff line number Diff line
@@ -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"
+1 −1
Original line number Diff line number Diff line
@@ -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
+0 −2
Original line number Diff line number Diff line
@@ -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