diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 20 |
1 files changed, 15 insertions, 5 deletions
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 72b2324a..92e1bd05 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -224,15 +224,25 @@ inline val String?.isVideoUrl */ inline val String?.isIndependent: Boolean get() { - if (this == null || length < 5) return false // ignore short queries - if (this[0] == '#' && !contains('/')) return false // ignore element values - if (startsWith("http") && !isFacebookUrl) return true // ignore non facebook urls - if (dependentSet.any { contains(it) }) return false // ignore known dependent segments + if (this == null || length < 5) return false // ignore short queries + if (this[0] == '#' && !contains('/')) return false // ignore element values + if (startsWith("http") && !isFacebookUrl) return true // ignore non facebook urls + if (independentSegments.any { contains(it) }) return true // known independent segments + if (this.startsWith("#!/")) return false // ignore these links for now + if (dependentSegments.any { contains(it) }) return false // ignore known dependent segments return true } -val dependentSet = setOf( +val independentSegments = arrayOf( + "messages/read/?tid=cid" +) + +val dependentSegments = arrayOf( "photoset_token", "direct_action_execute", "messages/?pageNum", "sharer.php", + /** + * Editing images + */ + "/confirmation/?", /* * Facebook messages have the following cases for the tid query * mid* or id* for newer threads, which can be launched in new windows |