aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2016-03-06 19:42:55 +0100
committerlookshe <github@lookshe.org>2016-03-06 19:42:55 +0100
commit3c400703e082a1b180b35d891b8fb3460c7d5b87 (patch)
tree28738dd90fc41b4ab71897f38d324828778ad2e3 /src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java
parent72114d732427266024cdd6e27cd8d1aa60afae2f (diff)
parentf28d77dc42f6bac5a026e0b1c78562dee8de45ac (diff)
Merge branch 'trz/rebase' into trz/rename
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java36
1 files changed, 16 insertions, 20 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java
index e36007d7..34023d9f 100644
--- a/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java
+++ b/src/main/java/de/thedevstack/conversationsplus/crypto/OtrService.java
@@ -1,5 +1,18 @@
package de.thedevstack.conversationsplus.crypto;
+import net.java.otr4j.OtrEngineHost;
+import net.java.otr4j.OtrException;
+import net.java.otr4j.OtrPolicy;
+import net.java.otr4j.OtrPolicyImpl;
+import net.java.otr4j.crypto.OtrCryptoEngineImpl;
+import net.java.otr4j.crypto.OtrCryptoException;
+import net.java.otr4j.session.FragmenterInstructions;
+import net.java.otr4j.session.InstanceTag;
+import net.java.otr4j.session.SessionID;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
import java.math.BigInteger;
import java.security.KeyFactory;
import java.security.KeyPair;
@@ -11,32 +24,18 @@ import java.security.spec.DSAPrivateKeySpec;
import java.security.spec.DSAPublicKeySpec;
import java.security.spec.InvalidKeySpecException;
-import org.json.JSONException;
-import org.json.JSONObject;
-
import de.thedevstack.android.logcat.Logging;
-
-import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.ConversationsPlusPreferences;
+import de.thedevstack.conversationsplus.Config;
import de.thedevstack.conversationsplus.entities.Account;
import de.thedevstack.conversationsplus.entities.Conversation;
+import de.thedevstack.conversationsplus.generator.MessageGenerator;
import de.thedevstack.conversationsplus.services.XmppConnectionService;
-import de.thedevstack.conversationsplus.utils.CryptoHelper;
import de.thedevstack.conversationsplus.xmpp.chatstate.ChatState;
import de.thedevstack.conversationsplus.xmpp.jid.InvalidJidException;
import de.thedevstack.conversationsplus.xmpp.jid.Jid;
import de.thedevstack.conversationsplus.xmpp.stanzas.MessagePacket;
-import net.java.otr4j.OtrEngineHost;
-import net.java.otr4j.OtrException;
-import net.java.otr4j.OtrPolicy;
-import net.java.otr4j.OtrPolicyImpl;
-import net.java.otr4j.crypto.OtrCryptoEngineImpl;
-import net.java.otr4j.crypto.OtrCryptoException;
-import net.java.otr4j.session.InstanceTag;
-import net.java.otr4j.session.SessionID;
-import net.java.otr4j.session.FragmenterInstructions;
-
public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost {
private Account account;
@@ -181,10 +180,7 @@ public class OtrService extends OtrCryptoEngineImpl implements OtrEngineHost {
packet.setAttribute("to", session.getAccountID() + "/" + session.getUserID());
}
packet.setBody(body);
- 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");
+ MessageGenerator.addMessageHints(packet);
try {
Jid jid = Jid.fromSessionID(session);
Conversation conversation = mXmppConnectionService.find(account,jid);