aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-03-04 16:24:36 -0500
committerAllan Wang <me@allanwang.ca>2019-03-04 16:24:36 -0500
commitca6ecf83b15e96e65791e21749e3263296aef057 (patch)
treeeb012e19ae07f5ec1966ffdee463051201f3452d /app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
parentf77c652e612241e046d16690ca239cce44a00b07 (diff)
downloadfrost-ca6ecf83b15e96e65791e21749e3263296aef057.tar.gz
frost-ca6ecf83b15e96e65791e21749e3263296aef057.tar.bz2
frost-ca6ecf83b15e96e65791e21749e3263296aef057.zip
Add fbclid trimmer, resolves #1290
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.kt10
1 files changed, 8 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 2c171762..6208f401 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt
@@ -82,7 +82,13 @@ class FbUrlFormatter(url: String) {
builder.append(cleaned)
if (queries.isNotEmpty()) {
builder.append("?")
- queries.forEach { (k, v) -> builder.append("$k=$v&") }
+ queries.forEach { (k, v) ->
+ if (v.isEmpty()) {
+ builder.append("$k&")
+ } else {
+ builder.append("$k=$v&")
+ }
+ }
}
return builder.removeSuffix("&").toString()
}
@@ -121,7 +127,7 @@ class FbUrlFormatter(url: String) {
*
* acontext is not required for "friends interested in" notifications
*/
- val discardableQueries = arrayOf("ref", "refid", "SharedWith")
+ val discardableQueries = arrayOf("ref", "refid", "SharedWith", "fbclid")
val converter = listOf(
"\\3C " to "%3C", "\\3E " to "%3E", "\\23 " to "%23", "\\25 " to "%25",