aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
diff options
context:
space:
mode:
authorAndreas Straub <andy@strb.org>2015-07-03 13:27:35 +0200
committerAndreas Straub <andy@strb.org>2015-07-19 21:32:27 +0200
commitec6870307e0ecee8184ddfef73444290e9d15828 (patch)
tree40efdd07879b03e549fcfb85274fab7e7aad1136 /src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
parent18c1e15d002f415c4449afe06e6dc80aef5aeade (diff)
Properly track message sender
Previously, the sender was assumed to be the conversation counterpart. This broke carboned own-device messages. We now track the sender properly, and also set the status (sent by one of the own devices vs received from the counterpart) accordingly.
Diffstat (limited to 'src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java')
-rw-r--r--src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
index 470c5206..d4089b20 100644
--- a/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/eu/siacs/conversations/crypto/axolotl/AxolotlService.java
@@ -856,14 +856,14 @@ public class AxolotlService {
@Nullable
public XmppAxolotlMessage encrypt(Message message ){
- final XmppAxolotlMessage axolotlMessage = new XmppAxolotlMessage(message.getContact(),
+ final XmppAxolotlMessage axolotlMessage = new XmppAxolotlMessage(message.getContact().getJid().toBareJid(),
ownDeviceId, message.getBody());
- if(findSessionsforContact(axolotlMessage.getContact()).isEmpty()) {
+ if(findSessionsforContact(message.getContact()).isEmpty()) {
return null;
}
Log.d(Config.LOGTAG, "Building axolotl foreign headers...");
- for (XmppAxolotlSession session : findSessionsforContact(axolotlMessage.getContact())) {
+ for (XmppAxolotlSession session : findSessionsforContact(message.getContact())) {
Log.d(Config.LOGTAG, session.remoteAddress.toString());
//if(!session.isTrusted()) {
// TODO: handle this properly
@@ -910,7 +910,7 @@ public class AxolotlService {
public XmppAxolotlMessage.XmppAxolotlPlaintextMessage processReceiving(XmppAxolotlMessage message) {
XmppAxolotlMessage.XmppAxolotlPlaintextMessage plaintextMessage = null;
- AxolotlAddress senderAddress = new AxolotlAddress(message.getContact().getJid().toBareJid().toString(),
+ AxolotlAddress senderAddress = new AxolotlAddress(message.getFrom().toString(),
message.getSenderDeviceId());
XmppAxolotlSession session = sessions.get(senderAddress);