fixed destination bug
This commit is contained in:
parent
e29ce19f20
commit
0de0cb90a0
|
@ -1033,6 +1033,10 @@ public class XmppConnectionService extends Service {
|
||||||
this.convChangedListener.onConversationListChanged();
|
this.convChangedListener.onConversationListChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void clearConversationHistory(Conversation conversation) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public int getConversationCount() {
|
public int getConversationCount() {
|
||||||
return this.databaseBackend.getConversationCount();
|
return this.databaseBackend.getConversationCount();
|
||||||
|
|
|
@ -261,7 +261,7 @@ public class JingleConnection {
|
||||||
IqPacket activation = new IqPacket(IqPacket.TYPE_SET);
|
IqPacket activation = new IqPacket(IqPacket.TYPE_SET);
|
||||||
activation.setTo(connection.getJid());
|
activation.setTo(connection.getJid());
|
||||||
activation.query("http://jabber.org/protocol/bytestreams").setAttribute("sid", this.getSessionId());
|
activation.query("http://jabber.org/protocol/bytestreams").setAttribute("sid", this.getSessionId());
|
||||||
activation.query().addChild("activate").setContent(this.getResponder());
|
activation.query().addChild("activate").setContent(this.getCounterPart());
|
||||||
this.account.getXmppConnection().sendIqPacket(activation, new OnIqPacketReceived() {
|
this.account.getXmppConnection().sendIqPacket(activation, new OnIqPacketReceived() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -322,7 +322,8 @@ public class JingleConnection {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectWithCandidate(Element candidate) {
|
private void connectWithCandidate(Element candidate) {
|
||||||
final SocksConnection socksConnection = new SocksConnection(this,candidate);
|
boolean initating = candidate.getAttribute("cid").equals(mJingleConnectionManager.getPrimaryCandidateId(account));
|
||||||
|
final SocksConnection socksConnection = new SocksConnection(this,candidate,initating);
|
||||||
connections.put(socksConnection.getCid(), socksConnection);
|
connections.put(socksConnection.getCid(), socksConnection);
|
||||||
socksConnection.connect(new OnSocksConnection() {
|
socksConnection.connect(new OnSocksConnection() {
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class SocksConnection {
|
||||||
private InputStream inputStream;
|
private InputStream inputStream;
|
||||||
private boolean isEstablished = false;
|
private boolean isEstablished = false;
|
||||||
|
|
||||||
public SocksConnection(JingleConnection jingleConnection, Element candidate) {
|
public SocksConnection(JingleConnection jingleConnection, Element candidate, boolean initating) {
|
||||||
this.cid = candidate.getAttribute("cid");
|
this.cid = candidate.getAttribute("cid");
|
||||||
this.host = candidate.getAttribute("host");
|
this.host = candidate.getAttribute("host");
|
||||||
this.port = Integer.parseInt(candidate.getAttribute("port"));
|
this.port = Integer.parseInt(candidate.getAttribute("port"));
|
||||||
|
@ -41,8 +41,13 @@ public class SocksConnection {
|
||||||
MessageDigest mDigest = MessageDigest.getInstance("SHA-1");
|
MessageDigest mDigest = MessageDigest.getInstance("SHA-1");
|
||||||
StringBuilder destBuilder = new StringBuilder();
|
StringBuilder destBuilder = new StringBuilder();
|
||||||
destBuilder.append(jingleConnection.getSessionId());
|
destBuilder.append(jingleConnection.getSessionId());
|
||||||
destBuilder.append(jingleConnection.getInitiator());
|
if (initating) {
|
||||||
destBuilder.append(jingleConnection.getResponder());
|
destBuilder.append(jingleConnection.getAccountJid());
|
||||||
|
destBuilder.append(jingleConnection.getCounterPart());
|
||||||
|
} else {
|
||||||
|
destBuilder.append(jingleConnection.getCounterPart());
|
||||||
|
destBuilder.append(jingleConnection.getAccountJid());
|
||||||
|
}
|
||||||
mDigest.reset();
|
mDigest.reset();
|
||||||
this.destination = CryptoHelper.bytesToHex(mDigest
|
this.destination = CryptoHelper.bytesToHex(mDigest
|
||||||
.digest(destBuilder.toString().getBytes()));
|
.digest(destBuilder.toString().getBytes()));
|
||||||
|
|
Loading…
Reference in New Issue