diff options
author | Allan Wang <me@allanwang.ca> | 2021-10-09 17:35:02 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-10-09 17:35:02 -0700 |
commit | 2dcef4c43680e71435d6f2b043f85bffc1ceb029 (patch) | |
tree | 1878f14b908a4a088325afe410f09c72304fc15d /app/src | |
parent | 30c45b61204cafdbfe8c71505ae9b47ebbc7763e (diff) | |
download | frost-2dcef4c43680e71435d6f2b043f85bffc1ceb029.tar.gz frost-2dcef4c43680e71435d6f2b043f85bffc1ceb029.tar.bz2 frost-2dcef4c43680e71435d6f2b043f85bffc1ceb029.zip |
Require no explicit intent before holding messenger urls
Diffstat (limited to 'app/src')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt | 7 |
1 files changed, 2 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 d655c458..33d1d9d1 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -307,14 +307,11 @@ fun Context.createPrivateMediaFile(extension: String) = createPrivateMediaFile(" /** * Tries to send the uri to the proper activity via an intent * returns [true] if activity is resolved, [false] otherwise - * For safety, any uri that [isFacebookUrl] without [isExplicitIntent] will return [false] + * For safety, any uri that ([isFacebookUrl] or [isMessengerUrl]) without [isExplicitIntent] will return [false] */ fun Context.startActivityForUri(uri: Uri): Boolean { val url = uri.toString() - if (url.isFacebookUrl && !url.isExplicitIntent) { - return false - } - if (url.isMessengerUrl) { + if ((url.isFacebookUrl || url.isMessengerUrl) && !url.isExplicitIntent) { return false } val intent = Intent( |