aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt10
2 files changed, 9 insertions, 4 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt
index 64f0b652..43bc5724 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt
@@ -3,8 +3,9 @@ package com.pitchedapps.frost.facebook
/**
* Created by Allan Wang on 2017-06-01.
*/
-const val HTTPS_FACEBOOK_COM = "https://facebook.com"
+
const val FACEBOOK_COM = "facebook.com"
+const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM"
const val FB_URL_BASE = "https://m.$FACEBOOK_COM/"
fun PROFILE_PICTURE_URL(id: Long) = "https://graph.facebook.com/$id/picture?type=large"
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 ccc4033c..5a83c3f3 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -221,17 +221,21 @@ inline val String?.isFacebookUrl
get() = this != null && contains(FACEBOOK_COM)
/**
- * [true] is url is a video and can be accepted by VideoViewer
+ * [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-"))
/**
- * [true] is url can be displayed in a different webview
+ * [true] if url can be displayed in a different webview
*/
inline val String?.isIndependent
get() = this == null || (startsWith("http") && !isFacebookUrl)
- || !contains("photoset_token")
+ || dependentSet.all { !contains(it) }
+
+val dependentSet = setOf(
+ "photoset_token", "direct_action_execute"
+)
inline val String?.isExplicitIntent
get() = this != null && startsWith("intent://")