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 15:34:12 +0100
commit47d44448f3c2e4527b23fcabc4ee65269094eda1 (patch)
tree85fbd9aff9e5656bbbd4a32755f1e92322021181 /src/main/java/eu/siacs/conversations/services/NotificationService.java
parente0f012dba1e8eba3a2d721d685d67ac7901e5c84 (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();