aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2018-04-13 00:13:28 -0400
committerGitHub <noreply@github.com>2018-04-13 00:13:28 -0400
commitc5e769deabeb80d7257b85c5c3d802cf46e6b191 (patch)
treeb3ac48678e893495b932c6500025db73a83e3d2b /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
parentd9e2562267e549ee407e683262406581f2c4888e (diff)
downloadfrost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.tar.gz
frost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.tar.bz2
frost-c5e769deabeb80d7257b85c5c3d802cf46e6b191.zip
Fix view full image (#882)v2.0.1
* Test including full photo viewer * Test cookie in glide * Fix parser and add redirects to view full image * Update changelog
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.kt5
1 files changed, 1 insertions, 4 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 f21c03e9..add35154 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
@@ -43,6 +43,7 @@ class FbUrlFormatter(url: String) {
L.e(e) { "Failed url formatting" }
return url
}
+ cleanedUrl = cleanedUrl.replace("&amp;", "&")
if (changed && !cleanedUrl.contains("?")) //ensure we aren't missing '?'
cleanedUrl = cleanedUrl.replaceFirst("&", "?")
val qm = cleanedUrl.indexOf("?")
@@ -54,8 +55,6 @@ class FbUrlFormatter(url: String) {
cleanedUrl = cleanedUrl.substring(0, qm)
}
discardableQueries.forEach { queries.remove(it) }
- //final cleanup
- misc.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v, true) }
if (cleanedUrl.startsWith("/")) cleanedUrl = FB_URL_BASE + cleanedUrl.substring(1)
cleanedUrl = cleanedUrl.replaceFirst(".facebook.com//", ".facebook.com/") //sometimes we are given a bad url
L.v { "Formatted url from $url to $cleanedUrl" }
@@ -101,8 +100,6 @@ class FbUrlFormatter(url: String) {
VIDEO_REDIRECT
)
- val misc = arrayOf("&amp;" to "&")
-
val discardableQueries = arrayOf("ref", "refid", "acontext", "SharedWith")
val converter = listOf(