mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-11 23:51:09 +01:00
Enable PacketExtensions for IQs
This is actually only part one, i.e. with this commit if the user adds a PacketExtension to an IQ it will be included in IQ.toXml(). Which was previously only the case if the IQ subclass explicitly included packet extensions. The second part of the change is to change the IQ provider, so that packet extensions are automatically parsed. Cases where PacketExtensions are used for Message and IQ are slightly changed. The IQ sublcass now only has a field with this PacketExtension (see for example bytestreams.ibb.packet.DataPacketExtension). Also changed hoxt API: Removed unnecessary indirection and made the API more Smack idiomatic.
This commit is contained in:
parent
a9c798f3bb
commit
9e797c1b17
93 changed files with 1347 additions and 1438 deletions
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.carbons.packet;
|
||||
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
import org.jivesoftware.smack.packet.SimpleIQ;
|
||||
|
||||
/**
|
||||
* Carbon IQs
|
||||
|
|
@ -24,29 +24,23 @@ import org.jivesoftware.smack.packet.IQ;
|
|||
public class Carbon {
|
||||
public static final String NAMESPACE = "urn:xmpp:carbons:2";
|
||||
|
||||
public static class Enable extends IQ {
|
||||
public static class Enable extends SimpleIQ {
|
||||
public static final String ELEMENT = "enable";
|
||||
|
||||
public Enable() {
|
||||
super(ELEMENT, NAMESPACE);
|
||||
setType(Type.set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChildElementXML() {
|
||||
return "<" + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
|
||||
}
|
||||
}
|
||||
|
||||
public static class Disable extends IQ {
|
||||
public static class Disable extends SimpleIQ {
|
||||
public static final String ELEMENT = "disable";
|
||||
|
||||
public Disable() {
|
||||
super(ELEMENT, NAMESPACE);
|
||||
setType(Type.set);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChildElementXML() {
|
||||
return "<" + ELEMENT + " xmlns='" + NAMESPACE + "'/>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue