mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 06:01:07 +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
|
|
@ -39,7 +39,7 @@ public class Close extends IQ {
|
|||
throw new IllegalArgumentException("Session ID must not be null or empty");
|
||||
}
|
||||
this.sessionID = sessionID;
|
||||
setType(Type.SET);
|
||||
setType(Type.set);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class Data extends IQ {
|
|||
* retrieved from IQ stanza and message stanza in the same way
|
||||
*/
|
||||
addExtension(data);
|
||||
setType(IQ.Type.SET);
|
||||
setType(IQ.Type.set);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class Open extends IQ {
|
|||
this.sessionID = sessionID;
|
||||
this.blockSize = blockSize;
|
||||
this.stanza = stanza;
|
||||
setType(Type.SET);
|
||||
setType(Type.set);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
*/
|
||||
private Bytestream createStreamHostRequest(String proxy) {
|
||||
Bytestream request = new Bytestream();
|
||||
request.setType(IQ.Type.GET);
|
||||
request.setType(IQ.Type.get);
|
||||
request.setTo(proxy);
|
||||
return request;
|
||||
}
|
||||
|
|
@ -695,7 +695,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
initiation.addStreamHost(streamHost);
|
||||
}
|
||||
|
||||
initiation.setType(IQ.Type.SET);
|
||||
initiation.setType(IQ.Type.set);
|
||||
initiation.setTo(targetJID);
|
||||
|
||||
return initiation;
|
||||
|
|
|
|||
|
|
@ -294,7 +294,7 @@ public class Socks5BytestreamRequest implements BytestreamRequest {
|
|||
private Bytestream createUsedHostResponse(StreamHost selectedHost) {
|
||||
Bytestream response = new Bytestream(this.bytestreamRequest.getSessionID());
|
||||
response.setTo(this.bytestreamRequest.getFrom());
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
response.setPacketID(this.bytestreamRequest.getPacketID());
|
||||
response.setUsedHost(selectedHost.getJID());
|
||||
return response;
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ class Socks5ClientForInitiator extends Socks5Client {
|
|||
private Bytestream createStreamHostActivation() {
|
||||
Bytestream activate = new Bytestream(this.sessionID);
|
||||
activate.setMode(null);
|
||||
activate.setType(IQ.Type.SET);
|
||||
activate.setType(IQ.Type.set);
|
||||
activate.setTo(this.streamHost.getJID());
|
||||
|
||||
activate.setToActivate(this.target);
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ public class Bytestream extends IQ {
|
|||
StringBuilder buf = new StringBuilder();
|
||||
|
||||
buf.append("<query xmlns=\"http://jabber.org/protocol/bytestreams\"");
|
||||
if (this.getType().equals(IQ.Type.SET)) {
|
||||
if (this.getType().equals(IQ.Type.set)) {
|
||||
if (getSessionID() != null) {
|
||||
buf.append(" sid=\"").append(getSessionID()).append("\"");
|
||||
}
|
||||
|
|
@ -234,7 +234,7 @@ public class Bytestream extends IQ {
|
|||
buf.append(getToActivate().toXML());
|
||||
}
|
||||
}
|
||||
else if (this.getType().equals(IQ.Type.RESULT)) {
|
||||
else if (this.getType().equals(IQ.Type.result)) {
|
||||
buf.append(">");
|
||||
if (getUsedHost() != null) {
|
||||
buf.append(getUsedHost().toXML());
|
||||
|
|
@ -246,7 +246,7 @@ public class Bytestream extends IQ {
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (this.getType().equals(IQ.Type.GET)) {
|
||||
else if (this.getType().equals(IQ.Type.get)) {
|
||||
return buf.append("/>").toString();
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ public class EntityCapsManager extends Manager {
|
|||
XMPPConnection connection = connection();
|
||||
|
||||
DiscoverInfo discoverInfo = new DiscoverInfo();
|
||||
discoverInfo.setType(IQ.Type.RESULT);
|
||||
discoverInfo.setType(IQ.Type.result);
|
||||
discoverInfo.setNode(getLocalNodeVer());
|
||||
if (connection != null)
|
||||
discoverInfo.setFrom(connection.getUser());
|
||||
|
|
|
|||
|
|
@ -332,7 +332,7 @@ public class AdHocCommandManager extends Manager {
|
|||
*/
|
||||
private void processAdHocCommand(AdHocCommandData requestData) throws SmackException {
|
||||
// Only process requests of type SET
|
||||
if (requestData.getType() != IQ.Type.SET) {
|
||||
if (requestData.getType() != IQ.Type.set) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -364,7 +364,7 @@ public class AdHocCommandManager extends Manager {
|
|||
// corresponding sessioid
|
||||
LocalCommand command = newInstanceOfCmd(commandNode, sessionId);
|
||||
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
command.setData(response);
|
||||
|
||||
// Check that the requester has enough permission.
|
||||
|
|
@ -530,7 +530,7 @@ public class AdHocCommandManager extends Manager {
|
|||
|
||||
// Since all errors were passed, the response is now a
|
||||
// result
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
|
||||
// Set the new data to the command.
|
||||
command.setData(response);
|
||||
|
|
@ -623,7 +623,7 @@ public class AdHocCommandManager extends Manager {
|
|||
* @throws NotConnectedException
|
||||
*/
|
||||
private void respondError(AdHocCommandData response, XMPPError error) throws NotConnectedException {
|
||||
response.setType(IQ.Type.ERROR);
|
||||
response.setType(IQ.Type.error);
|
||||
response.setError(error);
|
||||
connection().sendPacket(response);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ public class RemoteCommand extends AdHocCommand {
|
|||
// TODO: not throw the corresponding exeption. This will make a faster response,
|
||||
// TODO: since the request is stoped before it's sent.
|
||||
AdHocCommandData data = new AdHocCommandData();
|
||||
data.setType(IQ.Type.SET);
|
||||
data.setType(IQ.Type.set);
|
||||
data.setTo(getOwnerJID());
|
||||
data.setNode(getNode());
|
||||
data.setSessionID(sessionID);
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class AdHocCommandData extends IQ {
|
|||
}
|
||||
buf.append(">");
|
||||
|
||||
if (getType() == Type.RESULT) {
|
||||
if (getType() == Type.result) {
|
||||
buf.append("<actions");
|
||||
|
||||
if (executeAction != null) {
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
if (connection == null) return;
|
||||
DiscoverItems discoverItems = (DiscoverItems) packet;
|
||||
// Send back the items defined in the client if the request is of type GET
|
||||
if (discoverItems != null && discoverItems.getType() == IQ.Type.GET) {
|
||||
if (discoverItems != null && discoverItems.getType() == IQ.Type.get) {
|
||||
DiscoverItems response = new DiscoverItems();
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
response.setTo(discoverItems.getFrom());
|
||||
response.setPacketID(discoverItems.getPacketID());
|
||||
response.setNode(discoverItems.getNode());
|
||||
|
|
@ -139,7 +139,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
} else if(discoverItems.getNode() != null) {
|
||||
// Return <item-not-found/> error since client doesn't contain
|
||||
// the specified node
|
||||
response.setType(IQ.Type.ERROR);
|
||||
response.setType(IQ.Type.error);
|
||||
response.setError(new XMPPError(XMPPError.Condition.item_not_found));
|
||||
}
|
||||
connection.sendPacket(response);
|
||||
|
|
@ -157,9 +157,9 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
if (connection == null) return;
|
||||
DiscoverInfo discoverInfo = (DiscoverInfo) packet;
|
||||
// Answer the client's supported features if the request is of the GET type
|
||||
if (discoverInfo != null && discoverInfo.getType() == IQ.Type.GET) {
|
||||
if (discoverInfo != null && discoverInfo.getType() == IQ.Type.get) {
|
||||
DiscoverInfo response = new DiscoverInfo();
|
||||
response.setType(IQ.Type.RESULT);
|
||||
response.setType(IQ.Type.result);
|
||||
response.setTo(discoverInfo.getFrom());
|
||||
response.setPacketID(discoverInfo.getPacketID());
|
||||
response.setNode(discoverInfo.getNode());
|
||||
|
|
@ -185,7 +185,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
}
|
||||
else {
|
||||
// Return <item-not-found/> error since specified node was not found
|
||||
response.setType(IQ.Type.ERROR);
|
||||
response.setType(IQ.Type.error);
|
||||
response.setError(new XMPPError(XMPPError.Condition.item_not_found));
|
||||
}
|
||||
}
|
||||
|
|
@ -552,7 +552,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
public DiscoverInfo discoverInfo(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
// Discover the entity's info
|
||||
DiscoverInfo disco = new DiscoverInfo();
|
||||
disco.setType(IQ.Type.GET);
|
||||
disco.setType(IQ.Type.get);
|
||||
disco.setTo(entityID);
|
||||
disco.setNode(node);
|
||||
|
||||
|
|
@ -589,7 +589,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
public DiscoverItems discoverItems(String entityID, String node) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
// Discover the entity's items
|
||||
DiscoverItems disco = new DiscoverItems();
|
||||
disco.setType(IQ.Type.GET);
|
||||
disco.setType(IQ.Type.get);
|
||||
disco.setTo(entityID);
|
||||
disco.setNode(node);
|
||||
|
||||
|
|
@ -658,7 +658,7 @@ public class ServiceDiscoveryManager extends Manager {
|
|||
*/
|
||||
public void publishItems(String entityID, String node, DiscoverItems discoverItems) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
discoverItems.setType(IQ.Type.SET);
|
||||
discoverItems.setType(IQ.Type.set);
|
||||
discoverItems.setTo(entityID);
|
||||
discoverItems.setNode(node);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,7 +165,7 @@ public class LastActivityManager extends Manager {
|
|||
public void processPacket(Packet packet) throws NotConnectedException {
|
||||
if (!enabled) return;
|
||||
LastActivity message = new LastActivity();
|
||||
message.setType(IQ.Type.RESULT);
|
||||
message.setType(IQ.Type.result);
|
||||
message.setTo(packet.getFrom());
|
||||
message.setFrom(packet.getTo());
|
||||
message.setPacketID(packet.getPacketID());
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class LastActivity extends IQ {
|
|||
public String message;
|
||||
|
||||
public LastActivity() {
|
||||
setType(IQ.Type.GET);
|
||||
setType(IQ.Type.get);
|
||||
}
|
||||
|
||||
public LastActivity(String to) {
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ public class PrivateDataManager extends Manager {
|
|||
return buf.toString();
|
||||
}
|
||||
};
|
||||
privateDataGet.setType(IQ.Type.GET);
|
||||
privateDataGet.setType(IQ.Type.get);
|
||||
|
||||
PrivateDataResult response = (PrivateDataResult) connection().createPacketCollectorAndSend(
|
||||
privateDataGet).nextResultOrThrow();
|
||||
|
|
@ -190,7 +190,7 @@ public class PrivateDataManager extends Manager {
|
|||
return buf.toString();
|
||||
}
|
||||
};
|
||||
privateDataSet.setType(IQ.Type.SET);
|
||||
privateDataSet.setType(IQ.Type.set);
|
||||
|
||||
connection().createPacketCollectorAndSend(privateDataSet).nextResultOrThrow();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
* <pre>
|
||||
* // Request the version from the server.
|
||||
* Version versionRequest = new Version();
|
||||
* timeRequest.setType(IQ.Type.GET);
|
||||
* timeRequest.setType(IQ.Type.get);
|
||||
* timeRequest.setTo("example.com");
|
||||
*
|
||||
* // Create a packet collector to listen for a response.
|
||||
|
|
@ -40,7 +40,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
*
|
||||
* // Wait up to 5 seconds for a result.
|
||||
* IQ result = (IQ)collector.nextResult(5000);
|
||||
* if (result != null && result.getType() == IQ.Type.RESULT) {
|
||||
* if (result != null && result.getType() == IQ.Type.result) {
|
||||
* Version versionResult = (Version)result;
|
||||
* // Do something with result...
|
||||
* }</pre><p>
|
||||
|
|
@ -62,7 +62,7 @@ public class Version extends IQ {
|
|||
* @param os The operating system of the queried entity. This element is OPTIONAL.
|
||||
*/
|
||||
public Version(String name, String version, String os) {
|
||||
this.setType(IQ.Type.RESULT);
|
||||
this.setType(IQ.Type.result);
|
||||
this.name = name;
|
||||
this.version = version;
|
||||
this.os = os;
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ public class MultiUserChat {
|
|||
public Form getConfigurationForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCOwner iq = new MUCOwner();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.GET);
|
||||
iq.setType(IQ.Type.get);
|
||||
|
||||
IQ answer = (IQ) connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
|
||||
return Form.getFormFrom(answer);
|
||||
|
|
@ -585,7 +585,7 @@ public class MultiUserChat {
|
|||
public void sendConfigurationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCOwner iq = new MUCOwner();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
iq.addExtension(form.getDataFormToSend());
|
||||
|
||||
connection.createPacketCollectorAndSend(iq).nextResultOrThrow();
|
||||
|
|
@ -609,7 +609,7 @@ public class MultiUserChat {
|
|||
*/
|
||||
public Form getRegistrationForm() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
Registration reg = new Registration();
|
||||
reg.setType(IQ.Type.GET);
|
||||
reg.setType(IQ.Type.get);
|
||||
reg.setTo(room);
|
||||
|
||||
IQ result = (IQ) connection.createPacketCollectorAndSend(reg).nextResultOrThrow();
|
||||
|
|
@ -634,7 +634,7 @@ public class MultiUserChat {
|
|||
*/
|
||||
public void sendRegistrationForm(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
Registration reg = new Registration();
|
||||
reg.setType(IQ.Type.SET);
|
||||
reg.setType(IQ.Type.set);
|
||||
reg.setTo(room);
|
||||
reg.addExtension(form.getDataFormToSend());
|
||||
|
||||
|
|
@ -658,7 +658,7 @@ public class MultiUserChat {
|
|||
public void destroy(String reason, String alternateJID) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCOwner iq = new MUCOwner();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
|
||||
// Create the reason for the room destruction
|
||||
MUCOwner.Destroy destroy = new MUCOwner.Destroy();
|
||||
|
|
@ -1369,7 +1369,7 @@ public class MultiUserChat {
|
|||
throws XMPPErrorException, NoResponseException, NotConnectedException {
|
||||
MUCOwner iq = new MUCOwner();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
// Set the new affiliation.
|
||||
MUCOwner.Item item = new MUCOwner.Item(affiliation);
|
||||
item.setJid(jid);
|
||||
|
|
@ -1382,7 +1382,7 @@ public class MultiUserChat {
|
|||
throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCOwner iq = new MUCOwner();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
for (String jid : jids) {
|
||||
// Set the new affiliation.
|
||||
MUCOwner.Item item = new MUCOwner.Item(affiliation);
|
||||
|
|
@ -1407,7 +1407,7 @@ public class MultiUserChat {
|
|||
{
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
// Set the new affiliation.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
|
||||
item.setJid(jid);
|
||||
|
|
@ -1421,7 +1421,7 @@ public class MultiUserChat {
|
|||
throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
for (String jid : jids) {
|
||||
// Set the new affiliation.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
|
||||
|
|
@ -1435,7 +1435,7 @@ public class MultiUserChat {
|
|||
private void changeRole(String nickname, String role, String reason) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
// Set the new role.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
|
||||
item.setNick(nickname);
|
||||
|
|
@ -1448,7 +1448,7 @@ public class MultiUserChat {
|
|||
private void changeRole(Collection<String> nicknames, String role) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.SET);
|
||||
iq.setType(IQ.Type.set);
|
||||
for (String nickname : nicknames) {
|
||||
// Set the new role.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
|
||||
|
|
@ -1604,7 +1604,7 @@ public class MultiUserChat {
|
|||
private Collection<Affiliate> getAffiliatesByAdmin(String affiliation) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.GET);
|
||||
iq.setType(IQ.Type.get);
|
||||
// Set the specified affiliation. This may request the list of owners/admins/members/outcasts.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(affiliation, null);
|
||||
iq.addItem(item);
|
||||
|
|
@ -1656,7 +1656,7 @@ public class MultiUserChat {
|
|||
private Collection<Occupant> getOccupants(String role) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
MUCAdmin iq = new MUCAdmin();
|
||||
iq.setTo(room);
|
||||
iq.setType(IQ.Type.GET);
|
||||
iq.setType(IQ.Type.get);
|
||||
// Set the specified role. This may request the list of moderators/participants.
|
||||
MUCAdmin.Item item = new MUCAdmin.Item(null, role);
|
||||
iq.addItem(item);
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ public class PEPManager {
|
|||
public void publish(PEPItem item) throws NotConnectedException {
|
||||
// Create a new message to publish the event.
|
||||
PEPPubSub pubSub = new PEPPubSub(item);
|
||||
pubSub.setType(Type.SET);
|
||||
pubSub.setType(Type.set);
|
||||
//pubSub.setFrom(connection.getUser());
|
||||
|
||||
// Send the message that contains the roster
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class Ping extends IQ {
|
|||
|
||||
public Ping(String to) {
|
||||
setTo(to);
|
||||
setType(IQ.Type.GET);
|
||||
setType(IQ.Type.get);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class Pong extends IQ {
|
|||
* @param ping
|
||||
*/
|
||||
public Pong(Packet ping) {
|
||||
setType(IQ.Type.RESULT);
|
||||
setType(IQ.Type.result);
|
||||
setFrom(ping.getTo());
|
||||
setTo(ping.getFrom());
|
||||
setPacketID(ping.getPacketID());
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ public class PrivacyListManager extends Manager {
|
|||
*/
|
||||
private Privacy getRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
// The request is a get iq type
|
||||
requestPrivacy.setType(Privacy.Type.GET);
|
||||
requestPrivacy.setType(Privacy.Type.get);
|
||||
requestPrivacy.setFrom(this.getUser());
|
||||
|
||||
Privacy privacyAnswer = (Privacy) connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow();
|
||||
|
|
@ -168,7 +168,7 @@ public class PrivacyListManager extends Manager {
|
|||
*/
|
||||
private Packet setRequest(Privacy requestPrivacy) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
// The request is a get iq type
|
||||
requestPrivacy.setType(Privacy.Type.SET);
|
||||
requestPrivacy.setType(Privacy.Type.set);
|
||||
requestPrivacy.setFrom(this.getUser());
|
||||
|
||||
return connection().createPacketCollectorAndSend(requestPrivacy).nextResultOrThrow();
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public class LeafNode extends Node
|
|||
@SuppressWarnings("unchecked")
|
||||
public <T extends Item> List<T> getItems() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId()));
|
||||
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId()));
|
||||
|
||||
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -93,7 +93,7 @@ public class LeafNode extends Node
|
|||
@SuppressWarnings("unchecked")
|
||||
public <T extends Item> List<T> getItems(String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId));
|
||||
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId));
|
||||
|
||||
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -123,7 +123,7 @@ public class LeafNode extends Node
|
|||
{
|
||||
itemList.add(new Item(id));
|
||||
}
|
||||
PubSub request = createPubsubPacket(Type.GET, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
|
||||
PubSub request = createPubsubPacket(Type.get, new ItemsExtension(ItemsExtension.ItemsElementType.items, getId(), itemList));
|
||||
|
||||
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -143,7 +143,7 @@ public class LeafNode extends Node
|
|||
@SuppressWarnings("unchecked")
|
||||
public <T extends Item> List<T> getItems(int maxItems) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), maxItems));
|
||||
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), maxItems));
|
||||
|
||||
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -166,7 +166,7 @@ public class LeafNode extends Node
|
|||
@SuppressWarnings("unchecked")
|
||||
public <T extends Item> List<T> getItems(int maxItems, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.GET, new GetItemsRequest(getId(), subscriptionId, maxItems));
|
||||
PubSub request = createPubsubPacket(Type.get, new GetItemsRequest(getId(), subscriptionId, maxItems));
|
||||
|
||||
PubSub result = (PubSub) con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
ItemsExtension itemsElem = (ItemsExtension)result.getExtension(PubSubElementType.ITEMS);
|
||||
|
|
@ -188,7 +188,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public void publish() throws NotConnectedException
|
||||
{
|
||||
PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
|
||||
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
|
||||
|
||||
con.sendPacket(packet);
|
||||
}
|
||||
|
|
@ -233,7 +233,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public <T extends Item> void publish(Collection<T> items) throws NotConnectedException
|
||||
{
|
||||
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
|
||||
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(getId(), items));
|
||||
|
||||
con.sendPacket(packet);
|
||||
}
|
||||
|
|
@ -256,7 +256,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public void send() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub packet = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PUBLISH, getId()));
|
||||
PubSub packet = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PUBLISH, getId()));
|
||||
|
||||
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -311,7 +311,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public <T extends Item> void send(Collection<T> items) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub packet = createPubsubPacket(Type.SET, new PublishItem<T>(getId(), items));
|
||||
PubSub packet = createPubsubPacket(Type.set, new PublishItem<T>(getId(), items));
|
||||
|
||||
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -327,7 +327,7 @@ public class LeafNode extends Node
|
|||
*/
|
||||
public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace());
|
||||
PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()), PubSubElementType.PURGE_OWNER.getNamespace());
|
||||
|
||||
con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -363,7 +363,7 @@ public class LeafNode extends Node
|
|||
{
|
||||
items.add(new Item(id));
|
||||
}
|
||||
PubSub request = createPubsubPacket(Type.SET, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
|
||||
PubSub request = createPubsubPacket(Type.set, new ItemsExtension(ItemsExtension.ItemsElementType.retract, getId(), items));
|
||||
con.createPacketCollectorAndSend(request).nextResultOrThrow();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ abstract public class Node
|
|||
*/
|
||||
public ConfigureForm getNodeConfiguration() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER);
|
||||
Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.CONFIGURE_OWNER, getId()), PubSubNamespace.OWNER);
|
||||
return NodeUtils.getFormFromPacket(reply, PubSubElementType.CONFIGURE_OWNER);
|
||||
}
|
||||
|
||||
|
|
@ -112,7 +112,7 @@ abstract public class Node
|
|||
*/
|
||||
public void sendConfigurationForm(Form submitForm) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub packet = createPubsubPacket(Type.SET, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
|
||||
PubSub packet = createPubsubPacket(Type.set, new FormNode(FormNodeType.CONFIGURE_OWNER, getId(), submitForm), PubSubNamespace.OWNER);
|
||||
con.createPacketCollectorAndSend(packet).nextResultOrThrow();
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ abstract public class Node
|
|||
*/
|
||||
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()));
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS, getId()));
|
||||
SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS);
|
||||
return subElem.getSubscriptions();
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ abstract public class Node
|
|||
*/
|
||||
public Subscription subscribe(String jid) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
|
||||
return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
|
||||
}
|
||||
|
||||
|
|
@ -191,9 +191,9 @@ abstract public class Node
|
|||
*/
|
||||
public Subscription subscribe(String jid, SubscribeForm subForm) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(Type.SET, new SubscribeExtension(jid, getId()));
|
||||
PubSub request = createPubsubPacket(Type.set, new SubscribeExtension(jid, getId()));
|
||||
request.addExtension(new FormNode(FormNodeType.OPTIONS, subForm));
|
||||
PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.SET, request);
|
||||
PubSub reply = (PubSub)PubSubManager.sendPubsubPacket(con, jid, Type.set, request);
|
||||
return (Subscription)reply.getExtension(PubSubElementType.SUBSCRIPTION);
|
||||
}
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ abstract public class Node
|
|||
*/
|
||||
public void unsubscribe(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
sendPubsubPacket(Type.SET, new UnsubscribeExtension(jid, getId(), subscriptionId));
|
||||
sendPubsubPacket(Type.set, new UnsubscribeExtension(jid, getId(), subscriptionId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -256,7 +256,7 @@ abstract public class Node
|
|||
*/
|
||||
public SubscribeForm getSubscriptionOptions(String jid, String subscriptionId) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub packet = (PubSub)sendPubsubPacket(Type.GET, new OptionsExtension(jid, getId(), subscriptionId));
|
||||
PubSub packet = (PubSub)sendPubsubPacket(Type.get, new OptionsExtension(jid, getId(), subscriptionId));
|
||||
FormNode ext = (FormNode)packet.getExtension(PubSubElementType.OPTIONS);
|
||||
return new SubscribeForm(ext.getForm());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ final public class PubSubManager
|
|||
*/
|
||||
public LeafNode createNode() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.CREATE));
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.CREATE));
|
||||
NodeExtension elem = (NodeExtension)reply.getExtension("create", PubSubNamespace.BASIC.getXmlns());
|
||||
|
||||
LeafNode newNode = new LeafNode(con, elem.getNode());
|
||||
|
|
@ -126,7 +126,7 @@ final public class PubSubManager
|
|||
*/
|
||||
public Node createNode(String name, Form config) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub request = createPubsubPacket(to, Type.SET, new NodeExtension(PubSubElementType.CREATE, name));
|
||||
PubSub request = createPubsubPacket(to, Type.set, new NodeExtension(PubSubElementType.CREATE, name));
|
||||
boolean isLeafNode = true;
|
||||
|
||||
if (config != null)
|
||||
|
|
@ -140,7 +140,7 @@ final public class PubSubManager
|
|||
|
||||
// Errors will cause exceptions in getReply, so it only returns
|
||||
// on success.
|
||||
sendPubsubPacket(con, to, Type.SET, request);
|
||||
sendPubsubPacket(con, to, Type.set, request);
|
||||
Node newNode = isLeafNode ? new LeafNode(con, name) : new CollectionNode(con, name);
|
||||
newNode.setTo(to);
|
||||
nodeMap.put(newNode.getId(), newNode);
|
||||
|
|
@ -217,7 +217,7 @@ final public class PubSubManager
|
|||
*/
|
||||
public List<Subscription> getSubscriptions() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
Packet reply = sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.SUBSCRIPTIONS));
|
||||
Packet reply = sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.SUBSCRIPTIONS));
|
||||
SubscriptionsExtension subElem = (SubscriptionsExtension)reply.getExtension(PubSubElementType.SUBSCRIPTIONS.getElementName(), PubSubElementType.SUBSCRIPTIONS.getNamespace().getXmlns());
|
||||
return subElem.getSubscriptions();
|
||||
}
|
||||
|
|
@ -233,7 +233,7 @@ final public class PubSubManager
|
|||
*/
|
||||
public List<Affiliation> getAffiliations() throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.AFFILIATIONS));
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.AFFILIATIONS));
|
||||
AffiliationsExtension listElem = (AffiliationsExtension)reply.getExtension(PubSubElementType.AFFILIATIONS);
|
||||
return listElem.getAffiliations();
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ final public class PubSubManager
|
|||
*/
|
||||
public void deleteNode(String nodeId) throws NoResponseException, XMPPErrorException, NotConnectedException
|
||||
{
|
||||
sendPubsubPacket(Type.SET, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace());
|
||||
sendPubsubPacket(Type.set, new NodeExtension(PubSubElementType.DELETE, nodeId), PubSubElementType.DELETE.getNamespace());
|
||||
nodeMap.remove(nodeId);
|
||||
}
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ final public class PubSubManager
|
|||
{
|
||||
// Errors will cause exceptions in getReply, so it only returns
|
||||
// on success.
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.GET, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace());
|
||||
PubSub reply = (PubSub)sendPubsubPacket(Type.get, new NodeExtension(PubSubElementType.DEFAULT), PubSubElementType.DEFAULT.getNamespace());
|
||||
return NodeUtils.getFormFromPacket(reply, PubSubElementType.DEFAULT);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class UserSearch extends IQ {
|
|||
*/
|
||||
public Form getSearchForm(XMPPConnection con, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.GET);
|
||||
search.setType(IQ.Type.get);
|
||||
search.setTo(searchService);
|
||||
|
||||
IQ response = (IQ) con.createPacketCollectorAndSend(search).nextResultOrThrow();
|
||||
|
|
@ -86,7 +86,7 @@ public class UserSearch extends IQ {
|
|||
*/
|
||||
public ReportedData sendSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
UserSearch search = new UserSearch();
|
||||
search.setType(IQ.Type.SET);
|
||||
search.setType(IQ.Type.set);
|
||||
search.setTo(searchService);
|
||||
search.addExtension(searchForm.getDataFormToSend());
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ public class UserSearch extends IQ {
|
|||
public ReportedData sendSimpleSearchForm(XMPPConnection con, Form searchForm, String searchService) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
SimpleUserSearch search = new SimpleUserSearch();
|
||||
search.setForm(searchForm);
|
||||
search.setType(IQ.Type.SET);
|
||||
search.setType(IQ.Type.set);
|
||||
search.setTo(searchService);
|
||||
|
||||
SimpleUserSearch response = (SimpleUserSearch) con.createPacketCollectorAndSend(search).nextResultOrThrow();
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class SharedGroupManager {
|
|||
public static List<String> getSharedGroups(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
// Discover the shared groups of the logged user
|
||||
SharedGroupsInfo info = new SharedGroupsInfo();
|
||||
info.setType(IQ.Type.GET);
|
||||
info.setType(IQ.Type.get);
|
||||
|
||||
SharedGroupsInfo result = (SharedGroupsInfo) connection.createPacketCollectorAndSend(info).nextResultOrThrow();
|
||||
return result.getGroups();
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public class StreamInitiation extends IQ {
|
|||
*/
|
||||
public String getChildElementXML() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
if (this.getType().equals(IQ.Type.SET)) {
|
||||
if (this.getType().equals(IQ.Type.set)) {
|
||||
buf.append("<si xmlns=\"http://jabber.org/protocol/si\" ");
|
||||
if (getSessionID() != null) {
|
||||
buf.append("id=\"").append(getSessionID()).append("\" ");
|
||||
|
|
@ -151,7 +151,7 @@ public class StreamInitiation extends IQ {
|
|||
buf.append(fileXML);
|
||||
}
|
||||
}
|
||||
else if (this.getType().equals(IQ.Type.RESULT)) {
|
||||
else if (this.getType().equals(IQ.Type.result)) {
|
||||
buf.append("<si xmlns=\"http://jabber.org/protocol/si\">");
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class Time extends IQ {
|
|||
private String tzo;
|
||||
|
||||
public Time() {
|
||||
setType(Type.GET);
|
||||
setType(Type.get);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -123,7 +123,7 @@ public class Time extends IQ {
|
|||
|
||||
public static Time createResponse(Packet request) {
|
||||
Time time = new Time(Calendar.getInstance());
|
||||
time.setType(Type.RESULT);
|
||||
time.setType(Type.result);
|
||||
time.setTo(request.getFrom());
|
||||
return time;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -523,7 +523,7 @@ public class VCard extends IQ {
|
|||
public void save(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
checkAuthenticated(connection, true);
|
||||
|
||||
setType(IQ.Type.SET);
|
||||
setType(IQ.Type.set);
|
||||
setFrom(connection.getUser());
|
||||
connection.createPacketCollectorAndSend(this).nextResultOrThrow();
|
||||
}
|
||||
|
|
@ -556,7 +556,7 @@ public class VCard extends IQ {
|
|||
}
|
||||
|
||||
private void doLoad(XMPPConnection connection, String user) throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
setType(Type.GET);
|
||||
setType(Type.get);
|
||||
VCard result = (VCard) connection.createPacketCollectorAndSend(this).nextResultOrThrow();
|
||||
copyFieldsFrom(result);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue