aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/services/NotificationService.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-15 14:40:43 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-15 14:40:43 +0100
commit989ca229a2d4f32dde5ef4607dfbe96679e69b29 (patch)
treec19717482c217abe7ab8f73b37b5eaa95af4b35d /src/main/java/eu/siacs/conversations/services/NotificationService.java
parent995d1cbf61c2d7bf91afcaff1a0c4ff6a51b1de2 (diff)
fixed description in notifications and conversation overview
Diffstat (limited to 'src/main/java/eu/siacs/conversations/services/NotificationService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/services/NotificationService.java12
1 files changed, 10 insertions, 2 deletions
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();