aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
index 1090f1f3..e53bb202 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
@@ -15,8 +15,9 @@ class FbUrlFormatter(url: String) {
init {
var cleanedUrl = url
discardable.forEach { cleanedUrl = cleanedUrl.replace(it, "") }
+ val changed = cleanedUrl != url //note that discardables strip away the first ?
decoder.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v) }
- val qm = cleanedUrl.indexOf("?")
+ val qm = cleanedUrl.indexOf(if (changed)"&" else "?")
if (qm > -1) {
cleanedUrl.substring(qm + 1).split("&").forEach {
val p = it.split("=")
@@ -58,7 +59,8 @@ class FbUrlFormatter(url: String) {
"http://m.facebook.com/l.php?u=",
"https://m.facebook.com/l.php?u=",
"http://touch.facebook.com/l.php?u=",
- "https://touch.facebook.com/l.php?u="
+ "https://touch.facebook.com/l.php?u=",
+ "/video_redirect/?src="
)
@JvmStatic val discardableQueries = arrayOf("ref", "refid")