From 865e08401b3b6642a761b720f69ea26d04992384 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 24 Aug 2015 20:56:36 +0200 Subject: fixed regression with mlinks stream managment. fixes #1206 --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs/conversations/xmpp') diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 376858323..ddc3158ce 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -954,7 +954,7 @@ public class XmppConnection implements Runnable { AbstractAcknowledgeableStanza stanza = (AbstractAcknowledgeableStanza) packet; ++stanzasSent; this.mStanzaQueue.put(stanzasSent, stanza); - if (stanza instanceof MessagePacket && stanza.getId() != null && this.streamId != null) { + if (stanza instanceof MessagePacket && stanza.getId() != null && getFeatures().sm()) { if (Config.EXTENDED_SM_LOGGING) { Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": requesting ack for message stanza #" + stanzasSent); } -- cgit v1.2.3 From 476db24c10180c0100bbd9a2cfbc34b672464b74 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 25 Aug 2015 11:11:32 +0200 Subject: fixed session time --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/xmpp') diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index ddc3158ce..6a94a5f3e 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -318,7 +318,6 @@ public class XmppConnection implements Runnable { Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": stream management(" + smVersion + ") enabled"); } - this.lastSessionStarted = SystemClock.elapsedRealtime(); this.stanzasReceived = 0; final RequestPacket r = new RequestPacket(smVersion); tagWriter.writeStanzaAsync(r); @@ -784,6 +783,7 @@ public class XmppConnection implements Runnable { sendServiceDiscoveryInfo(account.getJid().toBareJid()); sendServiceDiscoveryItems(account.getServer()); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": online with resource " + account.getResource()); + this.lastSessionStarted = SystemClock.elapsedRealtime(); changeStatus(Account.State.ONLINE); if (bindListener != null) { bindListener.onBind(account); @@ -1100,12 +1100,7 @@ public class XmppConnection implements Runnable { } public long getLastSessionEstablished() { - final long diff; - if (this.lastSessionStarted == 0) { - diff = SystemClock.elapsedRealtime() - this.lastConnect; - } else { - diff = SystemClock.elapsedRealtime() - this.lastSessionStarted; - } + final long diff = SystemClock.elapsedRealtime() - this.lastSessionStarted; return System.currentTimeMillis() - diff; } -- cgit v1.2.3 From ae9de26f597b63733e584e65e51adbfd1df755ad Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 25 Aug 2015 12:40:22 +0200 Subject: remove unused imports. --- .../conversations/xmpp/jingle/JingleTransport.java | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/xmpp') diff --git a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleTransport.java b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleTransport.java index b32111584..e832d3f58 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleTransport.java +++ b/src/main/java/eu/siacs/conversations/xmpp/jingle/JingleTransport.java @@ -1,31 +1,5 @@ package eu.siacs.conversations.xmpp.jingle; -import android.util.Log; -import android.util.Pair; - -import org.bouncycastle.crypto.engines.AESEngine; -import org.bouncycastle.crypto.modes.AEADBlockCipher; -import org.bouncycastle.crypto.modes.GCMBlockCipher; -import org.bouncycastle.crypto.params.AEADParameters; -import org.bouncycastle.crypto.params.KeyParameter; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.InputStream; -import java.io.OutputStream; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; - -import javax.crypto.Cipher; -import javax.crypto.CipherInputStream; -import javax.crypto.CipherOutputStream; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; - -import eu.siacs.conversations.Config; import eu.siacs.conversations.entities.DownloadableFile; public abstract class JingleTransport { -- cgit v1.2.3 From f6b7a25e290d3ddfa46a5e704b05abe0e6b50dd5 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Wed, 26 Aug 2015 14:01:37 +0200 Subject: moved actual iq callback out of synchronized find callback block --- src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/eu/siacs/conversations/xmpp') diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 6a94a5f3e..bb0c3987b 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -472,29 +472,33 @@ public class XmppConnection implements Runnable { this.jingleListener.onJinglePacketReceived(account,(JinglePacket) packet); } } else { + OnIqPacketReceived callback = null; synchronized (this.packetCallbacks) { if (packetCallbacks.containsKey(packet.getId())) { final Pair packetCallbackDuple = packetCallbacks.get(packet.getId()); // Packets to the server should have responses from the server if (packetCallbackDuple.first.toServer(account)) { if (packet.fromServer(account)) { - packetCallbackDuple.second.onIqPacketReceived(account, packet); + callback = packetCallbackDuple.second; packetCallbacks.remove(packet.getId()); } else { Log.e(Config.LOGTAG, account.getJid().toBareJid().toString() + ": ignoring spoofed iq packet"); } } else { if (packet.getFrom().equals(packetCallbackDuple.first.getTo())) { - packetCallbackDuple.second.onIqPacketReceived(account, packet); + callback = packetCallbackDuple.second; packetCallbacks.remove(packet.getId()); } else { Log.e(Config.LOGTAG, account.getJid().toBareJid().toString() + ": ignoring spoofed iq packet"); } } } else if (packet.getType() == IqPacket.TYPE.GET || packet.getType() == IqPacket.TYPE.SET) { - this.unregisteredIqListener.onIqPacketReceived(account, packet); + callback = this.unregisteredIqListener; } } + if (callback != null) { + callback.onIqPacketReceived(account,packet); + } } } -- cgit v1.2.3