aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/generator/MessageGenerator.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/eu/siacs/conversations/generator/MessageGenerator.java')
-rw-r--r--src/eu/siacs/conversations/generator/MessageGenerator.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/generator/MessageGenerator.java b/src/eu/siacs/conversations/generator/MessageGenerator.java
index 4885177c..4449a7ec 100644
--- a/src/eu/siacs/conversations/generator/MessageGenerator.java
+++ b/src/eu/siacs/conversations/generator/MessageGenerator.java
@@ -151,4 +151,14 @@ public class MessageGenerator {
packet.addChild(x);
return packet;
}
+
+ public MessagePacket received(Account account, MessagePacket originalMessage, String namespace) {
+ MessagePacket receivedPacket = new MessagePacket();
+ receivedPacket.setType(MessagePacket.TYPE_NORMAL);
+ receivedPacket.setTo(originalMessage.getFrom());
+ receivedPacket.setFrom(account.getFullJid());
+ Element received = receivedPacket.addChild("received",namespace);
+ received.setAttribute("id", originalMessage.getId());
+ return receivedPacket;
+ }
}