aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/parser/MessageParser.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-07-24 01:04:25 +0200
committeriNPUTmice <daniel@gultsch.de>2014-07-24 01:04:25 +0200
commit7ee2ef5233b832fd419455ab78a26dff33a5da21 (patch)
tree63f4b8de4dcbb95b7b2bf3dc4af4899239127d74 /src/eu/siacs/conversations/parser/MessageParser.java
parent23e5fb5d5643ef915fda4819d3786e245cfcea88 (diff)
answer correctly if both markers and receipts are requested
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/parser/MessageParser.java20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/eu/siacs/conversations/parser/MessageParser.java b/src/eu/siacs/conversations/parser/MessageParser.java
index f6cd47ee..a4fcc810 100644
--- a/src/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/eu/siacs/conversations/parser/MessageParser.java
@@ -316,26 +316,20 @@ public class MessageParser extends AbstractParser implements
return;
} else if (packet.getType() == MessagePacket.TYPE_NORMAL) {
this.parseNormal(packet, account);
+ return;
}
if ((message == null) || (message.getBody() == null)) {
return;
}
if ((mXmppConnectionService.confirmMessages())
&& ((packet.getId() != null))) {
- MessagePacket receivedPacket = new MessagePacket();
- receivedPacket.setType(MessagePacket.TYPE_NORMAL);
- receivedPacket.setTo(message.getCounterpart());
- receivedPacket.setFrom(account.getFullJid());
if (packet.hasChild("markable", "urn:xmpp:chat-markers:0")) {
- Element received = receivedPacket.addChild("received",
- "urn:xmpp:chat-markers:0");
- received.setAttribute("id", packet.getId());
- account.getXmppConnection().sendMessagePacket(receivedPacket);
- } else if (packet.hasChild("request", "urn:xmpp:receipts")) {
- Element received = receivedPacket.addChild("received",
- "urn:xmpp:receipts");
- received.setAttribute("id", packet.getId());
- account.getXmppConnection().sendMessagePacket(receivedPacket);
+ MessagePacket receipt = mXmppConnectionService.getMessageGenerator().received(account, packet, "urn:xmpp:chat-markers:0");
+ mXmppConnectionService.sendMessagePacket(account, receipt);
+ }
+ if (packet.hasChild("request", "urn:xmpp:receipts")) {
+ MessagePacket receipt = mXmppConnectionService.getMessageGenerator().received(account, packet, "urn:xmpp:receipts");
+ mXmppConnectionService.sendMessagePacket(account, receipt);
}
}
Conversation conversation = message.getConversation();