mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-12 05:51:08 +01:00
Introduce StanzaBuilder
As first step to immutable Stanza types.
This commit is contained in:
parent
926c5892ad
commit
5db6191110
134 changed files with 2576 additions and 764 deletions
|
|
@ -34,6 +34,7 @@ import org.jivesoftware.smack.filter.StanzaTypeFilter;
|
|||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.smack.packet.Stanza;
|
||||
import org.jivesoftware.smack.packet.StanzaBuilder;
|
||||
import org.jivesoftware.smack.packet.StanzaError;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
|
||||
|
|
@ -835,8 +836,9 @@ public class InBandBytestreamSession implements BytestreamSession {
|
|||
@Override
|
||||
protected synchronized void writeToXML(DataPacketExtension data) throws NotConnectedException, InterruptedException {
|
||||
// create message stanza containing data packet
|
||||
Message message = new Message(remoteJID);
|
||||
message.addExtension(data);
|
||||
Message message = StanzaBuilder.buildMessage().to(remoteJID)
|
||||
.addExtension(data)
|
||||
.build();
|
||||
|
||||
connection.sendStanza(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -718,7 +718,7 @@ public final class Socks5BytestreamManager extends Manager implements Bytestream
|
|||
* @throws InterruptedException if the calling thread was interrupted.
|
||||
*/
|
||||
protected void replyRejectPacket(IQ packet) throws NotConnectedException, InterruptedException {
|
||||
StanzaError.Builder xmppError = StanzaError.getBuilder(StanzaError.Condition.not_acceptable);
|
||||
StanzaError xmppError = StanzaError.getBuilder(StanzaError.Condition.not_acceptable).build();
|
||||
IQ errorIQ = IQ.createErrorResponse(packet, xmppError);
|
||||
connection().sendStanza(errorIQ);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -333,7 +333,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
errorMessage = couldNotConnectException.getMessage();
|
||||
}
|
||||
|
||||
StanzaError.Builder error = StanzaError.from(StanzaError.Condition.item_not_found, errorMessage);
|
||||
StanzaError error = StanzaError.from(StanzaError.Condition.item_not_found, errorMessage).build();
|
||||
IQ errorIQ = IQ.createErrorResponse(this.bytestreamRequest, error);
|
||||
this.manager.getConnection().sendStanza(errorIQ);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue