aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/crypto/OtrEngine.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-08-11 13:46:32 +0200
committeriNPUTmice <daniel@gultsch.de>2014-08-11 13:46:32 +0200
commitf247abc2dc1aa7d19c8cd616f4654fc3a8d8109d (patch)
tree90d6c9abd690df2be2d3ebad643b1d5204bd48d3 /src/eu/siacs/conversations/crypto/OtrEngine.java
parent9960cb819edf18768759031a87b51d3e663d918f (diff)
handle bare jid presences. fixes for otr
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/crypto/OtrEngine.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/eu/siacs/conversations/crypto/OtrEngine.java b/src/eu/siacs/conversations/crypto/OtrEngine.java
index 01ba5e497..7960aa2be 100644
--- a/src/eu/siacs/conversations/crypto/OtrEngine.java
+++ b/src/eu/siacs/conversations/crypto/OtrEngine.java
@@ -154,13 +154,16 @@ public class OtrEngine implements OtrEngineHost {
@Override
public void injectMessage(SessionID session, String body) throws OtrException {
MessagePacket packet = new MessagePacket();
- packet.setFrom(account.getFullJid()); //sender
- packet.setTo(session.getAccountID()+"/"+session.getUserID()); //reciepient
+ packet.setFrom(account.getFullJid());
+ if (session.getUserID().isEmpty()) {
+ packet.setTo(session.getAccountID());
+ } else {
+ packet.setTo(session.getAccountID()+"/"+session.getUserID());
+ }
packet.setBody(body);
packet.addChild("private","urn:xmpp:carbons:2");
packet.addChild("no-copy","urn:xmpp:hints");
packet.setType(MessagePacket.TYPE_CHAT);
- //Log.d(LOGTAG,packet.toString());
account.getXmppConnection().sendMessagePacket(packet);
}