aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHermes Junior <ohermesjunior@gmail.com>2020-05-11 22:27:53 +0000
committerOHermesJunior <ohermesjunior@gmail.com>2020-05-11 22:27:53 +0000
commitccecc2b511bffc9711bd41b15aabccc2d179b9cd (patch)
tree33fcdc773827e9b71b885595554083ff9c455a96
parentadf8fa4e6a859029ac2d17ee79296e2afcda5b7a (diff)
downloadinfinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar.gz
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar.bz2
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar.lz
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar.xz
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.tar.zst
infinity-for-reddit-ccecc2b511bffc9711bd41b15aabccc2d179b9cd.zip
Handle alternative multireddit URL.
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
index defe8e3a..bacb5a68 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Activity/LinkResolverActivity.java
@@ -36,6 +36,7 @@ public class LinkResolverActivity extends AppCompatActivity {
private static final String USER_PATTERN = "/([uU]|user)/\\w+/{0,1}";
private static final String SIDEBAR_PATTERN = "/[rR]/\\w+/about/sidebar";
private static final String MULTIREDDIT_PATTERN = "/user/\\w+/m/\\w+/{0,1}";
+ private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?";
private static final String REDD_IT_POST_PATTERN = "/\\w+/{0,1}";
@Inject
@@ -136,6 +137,13 @@ public class LinkResolverActivity extends AppCompatActivity {
Intent intent = new Intent(this, ViewMultiRedditDetailActivity.class);
intent.putExtra(ViewMultiRedditDetailActivity.EXTRA_MULTIREDDIT_PATH, path);
startActivity(intent);
+ } else if (path.matches(MULTIREDDIT_PATTERN_2)) {
+ String subredditName = path.substring(3);
+ Intent intent = new Intent(this, ViewSubredditDetailActivity.class);
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_SUBREDDIT_NAME_KEY, subredditName);
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_MESSAGE_FULLNAME, messageFullname);
+ intent.putExtra(ViewSubredditDetailActivity.EXTRA_NEW_ACCOUNT_NAME, newAccountName);
+ startActivity(intent);
} else if (authority.equals("redd.it") && path.matches(REDD_IT_POST_PATTERN)) {
Intent intent = new Intent(this, ViewPostDetailActivity.class);
intent.putExtra(ViewPostDetailActivity.EXTRA_POST_ID, path.substring(1));