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 08ce1820..4abe0ae7 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -159,7 +159,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } } - private void displayStatus(ViewHolder viewHolder, Message message, int type, boolean darkBackground, boolean inValidSession) { + private void displayStatus(ViewHolder viewHolder, Message message, int type, boolean darkBackground) { String filesize = null; String info = null; boolean error = false; @@ -182,8 +182,10 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie FileParams params = message.getFileParams(); if (params.size > (1.5 * 1024 * 1024)) { filesize = params.size / (1024 * 1024)+ " MiB"; - } else if (params.size > 0) { + } else if (params.size >= 1024) { filesize = params.size / 1024 + " KiB"; + } else { + filesize = params.size + " B"; } if (message.getTransferable() != null && message.getTransferable().getStatus() == Transferable.STATUS_FAILED) { error = true; @@ -803,7 +805,7 @@ public class MessageAdapter extends ArrayAdapter implements CopyTextVie } } - displayStatus(viewHolder, message, type, darkBackground, isInValidSession); + displayStatus(viewHolder, message, type, darkBackground); return view; }