aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2021-04-01 01:14:36 +0000
committerAlex Ning <chineseperson5@gmail.com>2021-04-01 01:14:36 +0000
commit489da851cfa6615ab160813aa41767a8ff97c57a (patch)
tree20ef3840f0f4e8fd05e43458867470be16c8e135
parent398d53c162f32acb38feee588d2342d0876772ad (diff)
downloadinfinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar.gz
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar.bz2
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar.lz
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar.xz
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.tar.zst
infinity-for-reddit-489da851cfa6615ab160813aa41767a8ff97c57a.zip
Support reddit links from email.
-rw-r--r--app/src/main/AndroidManifest.xml6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java6
2 files changed, 10 insertions, 2 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 29a65fea..ce7ec3e3 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -268,6 +268,9 @@
android:host="s.reddit.com"
android:scheme="https" />
<data
+ android:host="click.redditmail.com"
+ android:scheme="https" />
+ <data
android:host="www.reddit.com"
android:scheme="http" />
<data
@@ -297,6 +300,9 @@
<data
android:host="s.reddit.com"
android:scheme="http" />
+ <data
+ android:host="click.redditmail.com"
+ android:scheme="http" />
</intent-filter>
</activity>
<activity
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java
index dc0e21ad..c823bf98 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java
@@ -7,7 +7,6 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
-import android.util.Log;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
@@ -185,6 +184,10 @@ public class LinkResolverActivity extends AppCompatActivity {
} else {
deepLinkError(uri);
}
+ } else if (authority.equals("click.redditmail.com")) {
+ if (path.startsWith("/CL0/")) {
+ handleUri(Uri.parse(path.substring("/CL0/".length())));
+ }
} else if (authority.contains("gfycat.com")) {
if (path.matches(GFYCAT_PATTERN)) {
Intent intent = new Intent(this, ViewVideoActivity.class);
@@ -246,7 +249,6 @@ public class LinkResolverActivity extends AppCompatActivity {
}
private void deepLinkError(Uri uri) {
- Log.i("ASDASFD", "s " + uri.toString());
PackageManager pm = getPackageManager();
String authority = uri.getAuthority();