diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 2 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 12 |
2 files changed, 12 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index 7bec8ce0..7422fb36 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -113,6 +113,8 @@ object Prefs : KPref() { var notificationKeywords: StringSet by kpref("notification_keywords", mutableSetOf()) + var notificationsGeneral: Boolean by kpref("notification_general", true) + var notificationAllAccounts: Boolean by kpref("notification_all_accounts", true) var notificationsInstantMessages: Boolean by kpref("notification_im", true) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index 1fb41dca..486fbae1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -250,8 +250,15 @@ inline val String?.isFacebookUrl /** * [true] if url is a video and can be accepted by VideoViewer */ -inline val String?.isVideoUrl - get() = this != null && (startsWith(VIDEO_REDIRECT) || startsWith("https://video-")) +inline val String.isVideoUrl + get() = startsWith(VIDEO_REDIRECT) || startsWith("https://video-") + +/** + * [true] if url is or redirects to an explicit facebook image + */ +inline val String.isImageUrl + get() = (contains("fbcdn.net") && (contains(".png") || contains(".jpg"))) + || contains("/photo/view_full_size") /** * [true] if url can be displayed in a different webview @@ -308,6 +315,7 @@ fun EmailBuilder.addFrostDetails() { addItem("Prev version", Prefs.prevVersionCode.toString()) val proTag = if (IS_FROST_PRO) "TY" else "FP" addItem("Random Frost ID", "${Prefs.frostId}-$proTag") + addItem("Locale", Locale.getDefault().displayName) } fun frostJsoup(url: String) |