mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-12-14 06:51:08 +01:00
Change IQ.Type to enum
This commit is contained in:
parent
944ac37fc3
commit
9be0c480e3
90 changed files with 284 additions and 299 deletions
|
|
@ -173,7 +173,7 @@ public class FileTransferManager {
|
|||
|
||||
IQ rejection = FileTransferNegotiator.createIQ(
|
||||
initiation.getPacketID(), initiation.getFrom(), initiation
|
||||
.getTo(), IQ.Type.ERROR);
|
||||
.getTo(), IQ.Type.error);
|
||||
rejection.setError(new XMPPError(XMPPError.Condition.no_acceptable));
|
||||
connection.sendPacket(rejection);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ public class FileTransferNegotiator {
|
|||
String errorMessage = "No stream methods contained in packet.";
|
||||
XMPPError error = new XMPPError(XMPPError.Condition.bad_request, errorMessage);
|
||||
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
|
||||
IQ.Type.ERROR);
|
||||
IQ.Type.error);
|
||||
iqPacket.setError(error);
|
||||
connection.sendPacket(iqPacket);
|
||||
throw new XMPPErrorException(errorMessage, error);
|
||||
|
|
@ -267,7 +267,7 @@ public class FileTransferNegotiator {
|
|||
}
|
||||
catch (XMPPErrorException e) {
|
||||
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
|
||||
IQ.Type.ERROR);
|
||||
IQ.Type.error);
|
||||
iqPacket.setError(e.getXMPPError());
|
||||
connection.sendPacket(iqPacket);
|
||||
throw e;
|
||||
|
|
@ -331,7 +331,7 @@ public class FileTransferNegotiator {
|
|||
public void rejectStream(final StreamInitiation si) throws NotConnectedException {
|
||||
XMPPError error = new XMPPError(XMPPError.Condition.forbidden, "Offer Declined");
|
||||
IQ iqPacket = createIQ(si.getPacketID(), si.getFrom(), si.getTo(),
|
||||
IQ.Type.ERROR);
|
||||
IQ.Type.error);
|
||||
iqPacket.setError(error);
|
||||
connection.sendPacket(iqPacket);
|
||||
}
|
||||
|
|
@ -396,7 +396,7 @@ public class FileTransferNegotiator {
|
|||
|
||||
si.setFrom(connection.getUser());
|
||||
si.setTo(userID);
|
||||
si.setType(IQ.Type.SET);
|
||||
si.setType(IQ.Type.set);
|
||||
|
||||
PacketCollector collector = connection.createPacketCollectorAndSend(si);
|
||||
Packet siResponse = collector.nextResult(responseTimeout);
|
||||
|
|
@ -404,7 +404,7 @@ public class FileTransferNegotiator {
|
|||
|
||||
if (siResponse instanceof IQ) {
|
||||
IQ iqResponse = (IQ) siResponse;
|
||||
if (iqResponse.getType().equals(IQ.Type.RESULT)) {
|
||||
if (iqResponse.getType().equals(IQ.Type.result)) {
|
||||
StreamInitiation response = (StreamInitiation) siResponse;
|
||||
return getOutgoingNegotiator(getStreamMethodField(response
|
||||
.getFeatureNegotiationForm()));
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ public class IBBTransferNegotiator extends StreamNegotiator {
|
|||
|
||||
// packet must by of type SET and contains the given session ID
|
||||
return this.sessionID.equals(bytestream.getSessionID())
|
||||
&& IQ.Type.SET.equals(bytestream.getType());
|
||||
&& IQ.Type.set.equals(bytestream.getType());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ public class Socks5TransferNegotiator extends StreamNegotiator {
|
|||
|
||||
// packet must by of type SET and contains the given session ID
|
||||
return this.sessionID.equals(bytestream.getSessionID())
|
||||
&& IQ.Type.SET.equals(bytestream.getType());
|
||||
&& IQ.Type.set.equals(bytestream.getType());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public abstract class StreamNegotiator {
|
|||
StreamInitiation response = new StreamInitiation();
|
||||
response.setTo(streamInitiationOffer.getFrom());
|
||||
response.setFrom(streamInitiationOffer.getTo());
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
response.setPacketID(streamInitiationOffer.getPacketID());
|
||||
|
||||
DataForm form = new DataForm(Form.TYPE_SUBMIT);
|
||||
|
|
@ -76,7 +76,7 @@ public abstract class StreamNegotiator {
|
|||
|
||||
|
||||
public IQ createError(String from, String to, String packetID, XMPPError xmppError) {
|
||||
IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.ERROR);
|
||||
IQ iq = FileTransferNegotiator.createIQ(packetID, to, from, IQ.Type.error);
|
||||
iq.setError(xmppError);
|
||||
return iq;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue