diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-03-04 21:30:34 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-03-04 21:30:34 +0100 |
commit | e9b4a2a021576a06671e63bb23b8daad6bda82bb (patch) | |
tree | b9976df8dbe0a450211e33588518918057245fb7 /src/main/java/eu/siacs | |
parent | 09d87965fbd77d5c3e463a168c56e4c9bac9fc2e (diff) |
show host in file size checker
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index f6496b21..54dd7f02 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -31,6 +31,7 @@ import android.widget.TextView; import android.widget.Toast; import java.lang.ref.WeakReference; +import java.net.URL; import java.util.List; import java.util.concurrent.RejectedExecutionException; import java.util.regex.Matcher; @@ -625,7 +626,19 @@ public class MessageAdapter extends ArrayAdapter<Message> { } else if (message.bodyIsHeart()) { displayHeartMessage(viewHolder, message.getBody().trim()); } else if (message.treatAsDownloadable() == Message.Decision.MUST) { - displayDownloadableMessage(viewHolder, message, activity.getString(R.string.check_x_filesize, UIHelper.getFileDescriptionString(activity, message))); + try { + URL url = new URL(message.getBody()); + displayDownloadableMessage(viewHolder, + message, + activity.getString(R.string.check_x_filesize_on_host, + UIHelper.getFileDescriptionString(activity, message), + url.getHost())); + } catch (Exception e) { + displayDownloadableMessage(viewHolder, + message, + activity.getString(R.string.check_x_filesize, + UIHelper.getFileDescriptionString(activity, message))); + } } else { displayTextMessage(viewHolder, message, darkBackground); } |