Handle Reddit home links.

This commit is contained in:
Hermes Junior 2020-05-11 01:17:14 +02:00 committed by OHermesJunior
parent f27f7c12a8
commit b31c96b2d9

View File

@ -80,6 +80,9 @@ public class LinkResolverActivity extends AppCompatActivity {
if (authority.equals("reddit.app.link") && path.isEmpty()) { if (authority.equals("reddit.app.link") && path.isEmpty()) {
String redirect = uri.getQueryParameter("$og_redirect"); String redirect = uri.getQueryParameter("$og_redirect");
handleUri(Uri.parse(redirect)); handleUri(Uri.parse(redirect));
} else if (path.isEmpty()) {
Intent intent = new Intent(this, MainActivity.class);
startActivity(intent);
} else if (path.matches(POST_PATTERN)) { } else if (path.matches(POST_PATTERN)) {
List<String> segments = uri.getPathSegments(); List<String> segments = uri.getPathSegments();
int commentsIndex = segments.lastIndexOf("comments"); int commentsIndex = segments.lastIndexOf("comments");