Skip to content

Commit

Permalink
Notify about handling cyclical intents
Browse files Browse the repository at this point in the history
  • Loading branch information
Mishiranu committed Sep 25, 2020
1 parent 4d239b4 commit c39c899
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/com/mishiranu/dashchan/ui/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,8 @@ private void navigateIntentUnchecked(Intent intent) {
} else {
Uri uri = intent.getData();
if (uri != null) {
if (!intent.getBooleanExtra(C.EXTRA_FROM_CLIENT, false)) {
navigateIntentUri(uri);
if (intent.getBooleanExtra(C.EXTRA_FROM_CLIENT, false) || !navigateIntentUri(uri)) {
ToastUtils.show(this, R.string.unknown_address);
}
} else {
String chanName = intent.getStringExtra(C.EXTRA_CHAN_NAME);
Expand All @@ -642,7 +642,7 @@ private void navigateIntentUnchecked(Intent intent) {
}
}

private void navigateIntentUri(Uri uri) {
private boolean navigateIntentUri(Uri uri) {
String chanName = ChanManager.getInstance().getChanNameByHost(uri.getAuthority());
if (chanName != null) {
ChanLocator locator = ChanLocator.get(chanName);
Expand All @@ -654,17 +654,17 @@ private void navigateIntentUri(Uri uri) {
if (boardUri) {
navigateIntentData(chanName, boardName, null, null, null, null,
NavigationUtils.FLAG_RETURNABLE);
return;
return true;
} else if (threadUri) {
navigateIntentData(chanName, boardName, threadNumber, postNumber, null, null,
NavigationUtils.FLAG_RETURNABLE);
return;
return true;
} else if (locator.isImageUri(uri)) {
navigateGalleryUri(uri);
return;
return true;
} else if (locator.isAudioUri(uri)) {
AudioPlayerService.start(this, chanName, uri, locator.createAttachmentFileName(uri));
return;
return true;
} else if (locator.isVideoUri(uri)) {
String fileName = locator.createAttachmentFileName(uri);
if (NavigationUtils.isOpenableVideoPath(fileName)) {
Expand All @@ -673,14 +673,14 @@ private void navigateIntentUri(Uri uri) {
NavigationUtils.handleUri(this, chanName, locator.convert(uri),
NavigationUtils.BrowserType.EXTERNAL);
}
return;
return true;
} else if (Preferences.isUseInternalBrowser()) {
NavigationUtils.handleUri(this, chanName, locator.convert(uri),
NavigationUtils.BrowserType.INTERNAL);
return;
return true;
}
}
ToastUtils.show(this, R.string.unknown_address);
return false;
}

private static boolean isSingleBoardMode(String chanName) {
Expand Down

0 comments on commit c39c899

Please sign in to comment.