aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/parser/MessageParser.java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-12-01 12:22:47 +0100
committerDaniel Gultsch <daniel@gultsch.de>2015-12-01 12:22:47 +0100
commitd42c82abf21d92ae1e8c7d12510d376800a2b363 (patch)
tree4170b94578e18fb18db2cce2ee8970ac27375bab /src/main/java/eu/siacs/conversations/parser/MessageParser.java
parent2225b0b6d5586d608b15d4e1ac13faa99b8971bf (diff)
combine multiple message receipts into single message
Diffstat (limited to 'src/main/java/eu/siacs/conversations/parser/MessageParser.java')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index 58ca5135..b4c648fe 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -7,6 +7,7 @@ import eu.siacs.conversations.crypto.PgpDecryptionService;
import net.java.otr4j.session.Session;
import net.java.otr4j.session.SessionStatus;
+import java.util.ArrayList;
import java.util.Set;
import eu.siacs.conversations.Config;
@@ -393,17 +394,17 @@ public class MessageParser extends AbstractParser implements
}
if (mXmppConnectionService.confirmMessages() && remoteMsgId != null && !isForwarded && !isTypeGroupChat) {
+ ArrayList<String> receiptsNamespaces = new ArrayList<>();
if (packet.hasChild("markable", "urn:xmpp:chat-markers:0")) {
- MessagePacket receipt = mXmppConnectionService.getMessageGenerator().received(account,
- packet,
- "urn:xmpp:chat-markers:0",
- MessagePacket.TYPE_CHAT);
- mXmppConnectionService.sendMessagePacket(account, receipt);
+ receiptsNamespaces.add("urn:xmpp:chat-markers:0");
}
if (packet.hasChild("request", "urn:xmpp:receipts")) {
+ receiptsNamespaces.add("urn:xmpp:receipts");
+ }
+ if (receiptsNamespaces.size() > 0) {
MessagePacket receipt = mXmppConnectionService.getMessageGenerator().received(account,
packet,
- "urn:xmpp:receipts",
+ receiptsNamespaces,
packet.getType());
mXmppConnectionService.sendMessagePacket(account, receipt);
}