1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-18 17:01:08 +01:00

Introduce StanzaBuilder

As first step to immutable Stanza types.
This commit is contained in:
Florian Schmaus 2019-10-24 15:45:08 +02:00
parent 926c5892ad
commit 5db6191110
134 changed files with 2576 additions and 764 deletions

View file

@ -172,7 +172,7 @@ public final class FileTransferManager extends Manager {
// 'not-acceptable' should be returned. This is done by Smack in
// Socks5BytestreamManager.replyRejectPacket(IQ).
IQ rejection = IQ.createErrorResponse(initiation, StanzaError.getBuilder(
StanzaError.Condition.forbidden));
StanzaError.Condition.forbidden).build());
connection().sendStanza(rejection);
}
}

View file

@ -194,7 +194,7 @@ public final class FileTransferNegotiator extends Manager {
if (streamMethodField == null) {
String errorMessage = "No stream methods contained in stanza.";
StanzaError.Builder error = StanzaError.from(StanzaError.Condition.bad_request, errorMessage);
StanzaError error = StanzaError.from(StanzaError.Condition.bad_request, errorMessage).build();
IQ iqPacket = IQ.createErrorResponse(si, error);
connection().sendStanza(iqPacket);
throw new FileTransferException.NoStreamMethodsOfferedException();
@ -206,7 +206,7 @@ public final class FileTransferNegotiator extends Manager {
selectedStreamNegotiator = getNegotiator(streamMethodField);
}
catch (NoAcceptableTransferMechanisms e) {
IQ iqPacket = IQ.createErrorResponse(si, StanzaError.from(StanzaError.Condition.bad_request, "No acceptable transfer mechanism"));
IQ iqPacket = IQ.createErrorResponse(si, StanzaError.from(StanzaError.Condition.bad_request, "No acceptable transfer mechanism").build());
connection().sendStanza(iqPacket);
throw e;
}