use url as fallback for remote url

This commit is contained in:
sk 2023-05-27 01:37:10 +02:00
parent c10d7cfee4
commit a6ac68499c
1 changed files with 6 additions and 2 deletions

View File

@ -44,7 +44,7 @@ public class FileStatusDisplayItem extends StatusDisplayItem{
@Override
public void onBind(FileStatusDisplayItem item) {
Uri url = Uri.parse(item.attachment.remoteUrl);
Uri url = Uri.parse(getUrl());
title.setText(item.attachment.description != null
? item.attachment.description
: url.getLastPathSegment());
@ -53,7 +53,11 @@ public class FileStatusDisplayItem extends StatusDisplayItem{
}
private void onClick(View v) {
UiUtils.openURL(itemView.getContext(), item.parentFragment.getAccountID(), item.attachment.remoteUrl);
UiUtils.openURL(itemView.getContext(), item.parentFragment.getAccountID(), getUrl());
}
private String getUrl() {
return item.attachment.remoteUrl == null ? item.attachment.url : item.attachment.remoteUrl;
}
}
}