aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java4
-rw-r--r--src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
index 33b7c6e46..bdcf32b4f 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnection.java
@@ -313,7 +313,7 @@ public class JingleConnection implements Transferable {
this.sendInitRequest();
} else {
gatherAndConnectDirectCandidates();
- this.mJingleConnectionManager.getPrimaryCandidate(account, (success, candidate) -> {
+ this.mJingleConnectionManager.getPrimaryCandidate(account, initiating(), (success, candidate) -> {
if (success) {
final JingleSocks5Transport socksConnection = new JingleSocks5Transport(this, candidate);
connections.put(candidate.getCid(), socksConnection);
@@ -594,7 +594,7 @@ public class JingleConnection implements Transferable {
private void sendAcceptSocks() {
gatherAndConnectDirectCandidates();
- this.mJingleConnectionManager.getPrimaryCandidate(this.account, (success, candidate) -> {
+ this.mJingleConnectionManager.getPrimaryCandidate(this.account, initiating(), (success, candidate) -> {
final JinglePacket packet = bootstrapPacket("session-accept");
final Content content = new Content(contentCreator, contentName);
content.setFileOffer(fileOffer, ftVersion);
diff --git a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java
index bef7a000d..068924bca 100644
--- a/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java
+++ b/src/main/java/de/pixart/messenger/xmpp/jingle/JingleConnectionManager.java
@@ -81,8 +81,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
this.connections.remove(connection);
}
- public void getPrimaryCandidate(Account account,
- final OnPrimaryCandidateFound listener) {
+ public void getPrimaryCandidate(final Account account, final boolean initiator, final OnPrimaryCandidateFound listener) {
if (Config.DISABLE_PROXY_LOOKUP) {
listener.onPrimaryCandidateFound(false, null);
return;
@@ -107,7 +106,7 @@ public class JingleConnectionManager extends AbstractConnectionManager {
candidate.setPort(Integer.parseInt(port));
candidate.setType(JingleCandidate.TYPE_PROXY);
candidate.setJid(proxy);
- candidate.setPriority(655360 + 65535);
+ candidate.setPriority(655360 + (initiator ? 10 : 20));
primaryCandidates.put(account.getJid().asBareJid(), candidate);
listener.onPrimaryCandidateFound(true, candidate);
} catch (final NumberFormatException e) {