aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/entities/Conversation.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-09-06 18:21:31 +0200
committeriNPUTmice <daniel@gultsch.de>2014-09-06 18:21:31 +0200
commit0e5a0a07fd32d185d2d4c43df9494fafcace9208 (patch)
treee51be0fc1b2cf156327274a66589f2709c9f1e09 /src/eu/siacs/conversations/entities/Conversation.java
parentdc0213710640911a796880fcd68a75d2b576918d (diff)
made otr a little bit more solid when there is no presence subscription
Diffstat (limited to '')
-rw-r--r--src/eu/siacs/conversations/entities/Conversation.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/eu/siacs/conversations/entities/Conversation.java b/src/eu/siacs/conversations/entities/Conversation.java
index 2097b2a4..9f7ba3aa 100644
--- a/src/eu/siacs/conversations/entities/Conversation.java
+++ b/src/eu/siacs/conversations/entities/Conversation.java
@@ -4,6 +4,7 @@ import java.security.interfaces.DSAPublicKey;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.utils.UIHelper;
import net.java.otr4j.OtrException;
@@ -43,7 +44,7 @@ public class Conversation extends AbstractEntity {
private int status;
private long created;
private int mode;
-
+
private long mutedTill = 0;
private String nextPresence;
@@ -223,15 +224,15 @@ public class Conversation extends AbstractEntity {
this.mode = mode;
}
- public SessionImpl startOtrSession(Context context, String presence,
- boolean sendStart) {
+ public SessionImpl startOtrSession(XmppConnectionService service,
+ String presence, boolean sendStart) {
if (this.otrSession != null) {
return this.otrSession;
} else {
- SessionID sessionId = new SessionID(this.getContactJid(), presence,
- "xmpp");
+ SessionID sessionId = new SessionID(
+ this.getContactJid().split("/")[0], presence, "xmpp");
this.otrSession = new SessionImpl(sessionId, getAccount()
- .getOtrEngine(context));
+ .getOtrEngine(service));
try {
if (sendStart) {
this.otrSession.startSession();
@@ -425,7 +426,7 @@ public class Conversation extends AbstractEntity {
public void setMutedTill(long mutedTill) {
this.mutedTill = mutedTill;
}
-
+
public boolean isMuted() {
return SystemClock.elapsedRealtime() < this.mutedTill;
}