mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-12 14:01:08 +01:00
Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
This commit is contained in:
parent
183af99ffb
commit
ed4fa3390f
58 changed files with 183 additions and 167 deletions
|
|
@ -442,7 +442,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
protected void replyRejectPacket(IQ request) throws NotConnectedException {
|
||||
XMPPError xmppError = new XMPPError(XMPPError.Condition.not_acceptable);
|
||||
IQ error = IQ.createErrorResponse(request, xmppError);
|
||||
this.connection.sendPacket(error);
|
||||
this.connection.sendStanza(error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -455,7 +455,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
protected void replyResourceConstraintPacket(IQ request) throws NotConnectedException {
|
||||
XMPPError xmppError = new XMPPError(XMPPError.Condition.resource_constraint);
|
||||
IQ error = IQ.createErrorResponse(request, xmppError);
|
||||
this.connection.sendPacket(error);
|
||||
this.connection.sendStanza(error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -468,7 +468,7 @@ public class InBandBytestreamManager implements BytestreamManager {
|
|||
protected void replyItemNotFoundPacket(IQ request) throws NotConnectedException {
|
||||
XMPPError xmppError = new XMPPError(XMPPError.Condition.item_not_found);
|
||||
IQ error = IQ.createErrorResponse(request, xmppError);
|
||||
this.connection.sendPacket(error);
|
||||
this.connection.sendStanza(error);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public class InBandBytestreamRequest implements BytestreamRequest {
|
|||
|
||||
// acknowledge request
|
||||
IQ resultIQ = IQ.createResultIQ(this.byteStreamRequest);
|
||||
connection.sendPacket(resultIQ);
|
||||
connection.sendStanza(resultIQ);
|
||||
|
||||
return ibbSession;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
// acknowledge close request
|
||||
IQ confirmClose = IQ.createResultIQ(closeRequest);
|
||||
this.connection.sendPacket(confirmClose);
|
||||
this.connection.sendStanza(confirmClose);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -457,7 +457,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
if (data.getSeq() <= this.lastSequence) {
|
||||
IQ unexpectedRequest = IQ.createErrorResponse((IQ) packet, new XMPPError(
|
||||
XMPPError.Condition.unexpected_request));
|
||||
connection.sendPacket(unexpectedRequest);
|
||||
connection.sendStanza(unexpectedRequest);
|
||||
return;
|
||||
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
// data is invalid; respond with bad-request error
|
||||
IQ badRequest = IQ.createErrorResponse((IQ) packet, new XMPPError(
|
||||
XMPPError.Condition.bad_request));
|
||||
connection.sendPacket(badRequest);
|
||||
connection.sendStanza(badRequest);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -476,7 +476,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
|
||||
// confirm IQ
|
||||
IQ confirmData = IQ.createResultIQ((IQ) packet);
|
||||
connection.sendPacket(confirmData);
|
||||
connection.sendStanza(confirmData);
|
||||
|
||||
// set last seen sequence
|
||||
this.lastSequence = data.getSeq();
|
||||
|
|
@ -808,7 +808,7 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
Message message = new Message(remoteJID);
|
||||
message.addExtension(data);
|
||||
|
||||
connection.sendPacket(message);
|
||||
connection.sendStanza(message);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -704,7 +704,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
protected void replyRejectPacket(IQ packet) throws NotConnectedException {
|
||||
XMPPError xmppError = new XMPPError(XMPPError.Condition.not_acceptable);
|
||||
IQ errorIQ = IQ.createErrorResponse(packet, xmppError);
|
||||
this.connection.sendPacket(errorIQ);
|
||||
this.connection.sendStanza(errorIQ);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
|
||||
// send used-host confirmation
|
||||
Bytestream response = createUsedHostResponse(selectedHost);
|
||||
this.manager.getConnection().sendPacket(response);
|
||||
this.manager.getConnection().sendStanza(response);
|
||||
|
||||
return new Socks5BytestreamSession(socket, selectedHost.getJID().equals(
|
||||
this.bytestreamRequest.getFrom()));
|
||||
|
|
@ -282,7 +282,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
String errorMessage = "Could not establish socket with any provided host";
|
||||
XMPPError error = XMPPError.from(XMPPError.Condition.item_not_found, errorMessage);
|
||||
IQ errorIQ = IQ.createErrorResponse(this.bytestreamRequest, error);
|
||||
this.manager.getConnection().sendPacket(errorIQ);
|
||||
this.manager.getConnection().sendStanza(errorIQ);
|
||||
throw new XMPPErrorException(errorMessage, error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue