aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-10-02 18:31:19 +0200
committeriNPUTmice <daniel@gultsch.de>2014-10-02 18:31:19 +0200
commitf8be57d43f83925d7f298ee1d34ef8cee32acec3 (patch)
treeea5eb22ae26473bba4dc81aec0017a44f8747f56 /src
parent4b09f0e9d3296b4b71d3b31c9102610cc8037d20 (diff)
show displayed by contact on all devices
Diffstat (limited to 'src')
-rw-r--r--src/eu/siacs/conversations/services/NotificationService.java14
-rw-r--r--src/eu/siacs/conversations/services/XmppConnectionService.java6
2 files changed, 9 insertions, 11 deletions
diff --git a/src/eu/siacs/conversations/services/NotificationService.java b/src/eu/siacs/conversations/services/NotificationService.java
index 1bc494b7..012bac30 100644
--- a/src/eu/siacs/conversations/services/NotificationService.java
+++ b/src/eu/siacs/conversations/services/NotificationService.java
@@ -15,9 +15,7 @@ import android.net.Uri;
import android.support.v4.app.NotificationCompat;
import android.support.v4.app.TaskStackBuilder;
import android.text.Html;
-import android.util.Log;
-import eu.siacs.conversations.Config;
import eu.siacs.conversations.R;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
@@ -43,10 +41,7 @@ public class NotificationService {
public synchronized void push(Message message) {
if (this.mIsInForeground
&& this.mOpenConversation == message.getConversation()) {
- Log.d(Config.LOGTAG,"ignoring notification because foreground and conv matches");
return; // simply ignore
- } else {
- Log.d(Config.LOGTAG,"pushed new notification");
}
String conversationUuid = message.getConversationUuid();
if (notifications.containsKey(conversationUuid)) {
@@ -143,9 +138,9 @@ public class NotificationService {
.getString(R.string.unread_conversations));
mBuilder.setContentText(names.toString());
mBuilder.setStyle(style);
- if (conversation!=null) {
+ if (conversation != null) {
mBuilder.setContentIntent(createContentIntent(conversation
- .getUuid()));
+ .getUuid()));
}
}
if (notify) {
@@ -183,9 +178,10 @@ public class NotificationService {
PendingIntent.FLAG_UPDATE_CURRENT);
return resultPendingIntent;
}
-
+
private PendingIntent createDeleteIntent() {
- Intent intent = new Intent(mXmppConnectionService, XmppConnectionService.class);
+ Intent intent = new Intent(mXmppConnectionService,
+ XmppConnectionService.class);
intent.setAction("clear_notification");
return PendingIntent.getService(mXmppConnectionService, 0, intent, 0);
}
diff --git a/src/eu/siacs/conversations/services/XmppConnectionService.java b/src/eu/siacs/conversations/services/XmppConnectionService.java
index 0676c603..ffef19ed 100644
--- a/src/eu/siacs/conversations/services/XmppConnectionService.java
+++ b/src/eu/siacs/conversations/services/XmppConnectionService.java
@@ -1545,7 +1545,9 @@ public class XmppConnectionService extends Service {
public boolean markMessage(Conversation conversation, String uuid,
int status) {
for (Message message : conversation.getMessages()) {
- if (message.getUuid().equals(uuid)) {
+ if (message.getUuid().equals(uuid)
+ || (message.getStatus() >= Message.STATUS_SEND && uuid
+ .equals(message.getRemoteMsgId()))) {
markMessage(message, status);
return true;
}
@@ -1758,7 +1760,7 @@ public class XmppConnectionService extends Service {
}
return contacts;
}
-
+
public NotificationService getNotificationService() {
return this.mNotificationService;
}