aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-09-28 22:48:50 -0700
committerAllan Wang <me@allanwang.ca>2019-09-28 22:48:50 -0700
commit8fb903398a3692e42d4ea8ddcf047937841f5901 (patch)
tree7d71b36131dd9a4a3895755f181f563f25377e6e /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
parent96908453abbd7e40e13af4359d1bce4524b979a6 (diff)
downloadfrost-8fb903398a3692e42d4ea8ddcf047937841f5901.tar.gz
frost-8fb903398a3692e42d4ea8ddcf047937841f5901.tar.bz2
frost-8fb903398a3692e42d4ea8ddcf047937841f5901.zip
Convert desktop urls to mobile ones
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.kt2
1 files changed, 2 insertions, 0 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 2095f8fd..006fc3ca 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
@@ -78,6 +78,8 @@ class FbUrlFormatter(url: String) {
cleanedUrl = cleanedUrl.substring(0, qm)
}
discardableQueries.forEach { queries.remove(it) }
+ // Convert desktop urls to mobile ones
+ cleanedUrl = cleanedUrl.replace(WWW_FACEBOOK_COM, FACEBOOK_BASE_COM)
if (cleanedUrl.startsWith("/")) cleanedUrl = FB_URL_BASE + cleanedUrl.substring(1)
cleanedUrl = cleanedUrl.replaceFirst(
".facebook.com//",