diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
3 files changed, 18 insertions, 3 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index e15a6bbc7..da788b430 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -44,6 +44,7 @@ import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Contact; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Downloadable; +import eu.siacs.conversations.entities.DownloadablePlaceholder; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.entities.MucOptions; import eu.siacs.conversations.entities.Presences; @@ -367,7 +368,7 @@ public class ConversationFragment extends Fragment { downloadImage.setVisible(false); } if (this.selectedMessage.getDownloadable() == null - || this.selectedMessage.getDownloadable().getStatus() == Downloadable.STATUS_DELETED) { + || this.selectedMessage.getDownloadable() instanceof DownloadablePlaceholder) { cancelTransmission.setVisible(false); } } diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index b1aea2094..b81544e64 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -104,7 +104,17 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { } else if (d.getStatus() == Downloadable.STATUS_OFFER_CHECK_FILESIZE) { mLastMessage.setText(R.string.image_offered_for_download); } else if (d.getStatus() == Downloadable.STATUS_DELETED) { - mLastMessage.setText(R.string.image_file_deleted); + if (message.getType() == Message.TYPE_FILE) { + mLastMessage.setText(R.string.file_deleted); + } else { + mLastMessage.setText(R.string.image_file_deleted); + } + } else if (d.getStatus() == Downloadable.STATUS_FAILED) { + if (message.getType() == Message.TYPE_FILE) { + mLastMessage.setText(R.string.file_transmission_failed); + } else { + mLastMessage.setText(R.string.image_transmission_failed); + } } else if (message.getImageParams().width > 0) { mLastMessage.setVisibility(View.GONE); imagePreview.setVisibility(View.VISIBLE); 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 71795e986..c82f5be79 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -505,7 +505,11 @@ public class MessageAdapter extends ArrayAdapter<Message> { } else if (d.getStatus() == Downloadable.STATUS_OFFER_CHECK_FILESIZE) { displayDownloadableMessage(viewHolder, item,activity.getString(R.string.check_image_filesize)); } else if (d.getStatus() == Downloadable.STATUS_FAILED) { - displayInfoMessage(viewHolder, activity.getString(R.string.image_transmission_failed)); + if (item.getType() == Message.TYPE_FILE) { + displayInfoMessage(viewHolder, activity.getString(R.string.file_transmission_failed)); + } else { + displayInfoMessage(viewHolder, activity.getString(R.string.image_transmission_failed)); + } } } else if (item.getType() == Message.TYPE_IMAGE && item.getEncryption() != Message.ENCRYPTION_PGP && item.getEncryption() != Message.ENCRYPTION_DECRYPTION_FAILED) { displayImageMessage(viewHolder, item); |