aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/generator
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-09-01 22:36:56 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-09-01 22:36:56 +0200
commit91b0605bc29cbba55abbb32293c4b632608a00bf (patch)
tree1f1671e9bd475ec117e1240578cef74429ca3b33 /src/main/java/eu/siacs/conversations/generator
parent74cf8320bcf918bf8b3511e752850e921a2f4df3 (diff)
use same method to add message hints to otr message everywhere it is needed
Diffstat (limited to 'src/main/java/eu/siacs/conversations/generator')
-rw-r--r--src/main/java/eu/siacs/conversations/generator/MessageGenerator.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
index 2db66607..11aa9606 100644
--- a/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
+++ b/src/main/java/eu/siacs/conversations/generator/MessageGenerator.java
@@ -64,20 +64,24 @@ public class MessageGenerator extends AbstractGenerator {
return null;
}
packet.setAxolotlMessage(axolotlMessage.toElement());
- packet.addChild("pretty-please-store","urn:xmpp:hints");
+ packet.addChild("pretty-please-store", "urn:xmpp:hints");
return packet;
}
+ public static void addMessageHints(MessagePacket packet) {
+ packet.addChild("private", "urn:xmpp:carbons:2");
+ packet.addChild("no-copy", "urn:xmpp:hints");
+ packet.addChild("no-permanent-store", "urn:xmpp:hints");
+ packet.addChild("no-permanent-storage", "urn:xmpp:hints"); //do not copy this. this is wrong. it is *store*
+ }
+
public MessagePacket generateOtrChat(Message message) {
Session otrSession = message.getConversation().getOtrSession();
if (otrSession == null) {
return null;
}
MessagePacket packet = preparePacket(message);
- packet.addChild("private", "urn:xmpp:carbons:2");
- packet.addChild("no-copy", "urn:xmpp:hints");
- packet.addChild("no-permanent-store", "urn:xmpp:hints");
- packet.addChild("no-permanent-storage", "urn:xmpp:hints");
+ addMessageHints(packet);
try {
String content;
if (message.hasFileOnRemoteHost()) {