use of de.pixart.messenger.xmpp.jingle.stanzas.JinglePacket in project Pix-Art-Messenger by kriztan.
the class JingleConnection method sendCancel.
private void sendCancel() {
JinglePacket packet = bootstrapPacket("session-terminate");
Reason reason = new Reason();
reason.addChild("cancel");
packet.setReason(reason);
this.sendJinglePacket(packet);
}
use of de.pixart.messenger.xmpp.jingle.stanzas.JinglePacket in project Pix-Art-Messenger by kriztan.
the class JingleConnection method sendCandidateError.
private void sendCandidateError() {
JinglePacket packet = bootstrapPacket("transport-info");
Content content = new Content(this.contentCreator, this.contentName);
content.setTransportId(this.transportId);
content.socks5transport().addChild("candidate-error");
packet.setContent(content);
this.sentCandidate = true;
if (receivedCandidate && mJingleStatus == JINGLE_STATUS_ACCEPTED) {
connect();
}
this.sendJinglePacket(packet);
}
use of de.pixart.messenger.xmpp.jingle.stanzas.JinglePacket in project Pix-Art-Messenger by kriztan.
the class JingleConnection method receiveFallbackToIbb.
private boolean receiveFallbackToIbb(JinglePacket packet) {
Log.d(Config.LOGTAG, "receiving fallack to ibb");
String receivedBlockSize = packet.getJingleContent().ibbTransport().getAttribute("block-size");
if (receivedBlockSize != null) {
int bs = Integer.parseInt(receivedBlockSize);
if (bs > this.ibbBlockSize) {
this.ibbBlockSize = bs;
}
}
this.transportId = packet.getJingleContent().getTransportId();
this.transport = new JingleInbandTransport(this, this.transportId, this.ibbBlockSize);
JinglePacket answer = bootstrapPacket("transport-accept");
Content content = new Content("initiator", "a-file-offer");
content.setTransportId(this.transportId);
content.ibbTransport().setAttribute("block-size", this.ibbBlockSize);
answer.setContent(content);
if (initiating()) {
this.sendJinglePacket(answer, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
if (packet.getType() == IqPacket.TYPE.RESULT) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + " recipient ACKed our transport-accept. creating ibb");
transport.connect(onIbbTransportConnected);
}
}
});
} else {
this.transport.receive(file, onFileTransmissionStatusChanged);
this.sendJinglePacket(answer);
}
return true;
}
Aggregations