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

Commit b91778ad authored by Philipp Heckel's avatar Philipp Heckel
Browse files

Fix Firebase-only "link expired" issue

parent 3082319c
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -443,6 +443,10 @@ fun String.readBitmapFromUriOrNull(context: Context): Bitmap? {
    }
}

fun Long.nullIfZero(): Long? {
    return if (this == 0L) return null else this
}

// TextWatcher that only implements the afterTextChanged method
class AfterChangedTextWatcher(val afterTextChangedFn: (s: Editable?) -> Unit) : TextWatcher {
    override fun afterTextChanged(s: Editable?) {
+3 −2
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ import io.heckel.ntfy.msg.ApiService
import io.heckel.ntfy.msg.NotificationDispatcher
import io.heckel.ntfy.msg.NotificationParser
import io.heckel.ntfy.service.SubscriberService
import io.heckel.ntfy.util.nullIfZero
import io.heckel.ntfy.util.toPriority
import io.heckel.ntfy.util.topicShortUrl
import io.heckel.ntfy.work.PollWorker
@@ -94,8 +95,8 @@ class FirebaseService : FirebaseMessagingService() {
        val encoding = data["encoding"]
        val attachmentName = data["attachment_name"] ?: "attachment.bin"
        val attachmentType = data["attachment_type"]
        val attachmentSize = data["attachment_size"]?.toLongOrNull()
        val attachmentExpires = data["attachment_expires"]?.toLongOrNull()
        val attachmentSize = data["attachment_size"]?.toLongOrNull()?.nullIfZero()
        val attachmentExpires = data["attachment_expires"]?.toLongOrNull()?.nullIfZero()
        val attachmentUrl = data["attachment_url"]
        val truncated = (data["truncated"] ?: "") == "1"
        if (id == null || topic == null || message == null || timestamp == null) {
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ Bug fixes + maintenance:
* Fix topics do not re-subscribe to Firebase after restoring from backup (#511)
* Fix crashes from large images (#474, thanks to @daedric7 for reporting)
* Fix notification click opens wrong subscription (#261, thanks to @SMAW for reporting)
* Fix Firebase-only "link expired" issue (#529)
* Add donate button (no ticket)

Additional translations: