From 47d44448f3c2e4527b23fcabc4ee65269094eda1 Mon Sep 17 00:00:00 2001 From: iNPUTmice Date: Sat, 15 Nov 2014 14:40:43 +0100 Subject: fixed description in notifications and conversation overview --- .../eu/siacs/conversations/services/NotificationService.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/services/NotificationService.java') diff --git a/src/main/java/eu/siacs/conversations/services/NotificationService.java b/src/main/java/eu/siacs/conversations/services/NotificationService.java index 4cb28145..385aab92 100644 --- a/src/main/java/eu/siacs/conversations/services/NotificationService.java +++ b/src/main/java/eu/siacs/conversations/services/NotificationService.java @@ -28,6 +28,7 @@ import eu.siacs.conversations.R; import eu.siacs.conversations.entities.Account; import eu.siacs.conversations.entities.Conversation; import eu.siacs.conversations.entities.Downloadable; +import eu.siacs.conversations.entities.DownloadableFile; import eu.siacs.conversations.entities.Message; import eu.siacs.conversations.ui.ConversationActivity; @@ -266,14 +267,21 @@ public class NotificationService { if (message.getDownloadable() != null && (message.getDownloadable().getStatus() == Downloadable.STATUS_OFFER || message .getDownloadable().getStatus() == Downloadable.STATUS_OFFER_CHECK_FILESIZE)) { - return mXmppConnectionService.getText( - R.string.image_offered_for_download).toString(); + if (message.getType() == Message.TYPE_FILE) { + return mXmppConnectionService.getString(R.string.file_offered_for_download); + } else { + return mXmppConnectionService.getText( + R.string.image_offered_for_download).toString(); + } } else if (message.getEncryption() == Message.ENCRYPTION_PGP) { return mXmppConnectionService.getText( R.string.encrypted_message_received).toString(); } else if (message.getEncryption() == Message.ENCRYPTION_DECRYPTION_FAILED) { return mXmppConnectionService.getText(R.string.decryption_failed) .toString(); + } else if (message.getType() == Message.TYPE_FILE) { + DownloadableFile file = mXmppConnectionService.getFileBackend().getFile(message); + return mXmppConnectionService.getString(R.string.file,file.getMimeType()); } else if (message.getType() == Message.TYPE_IMAGE) { return mXmppConnectionService.getText(R.string.image_file) .toString(); -- cgit v1.2.3