mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 09:09:38 +02:00
Add XMPP.(get|has)Feature(Class|QName) and deprecate (String, String)
This commit is contained in:
parent
91337150e7
commit
329948b442
13 changed files with 78 additions and 18 deletions
|
@ -339,7 +339,7 @@ public final class EntityCapsManager extends Manager {
|
|||
}
|
||||
private void processCapsStreamFeatureIfAvailable(XMPPConnection connection) {
|
||||
CapsExtension capsExtension = connection.getFeature(
|
||||
CapsExtension.ELEMENT, CapsExtension.NAMESPACE);
|
||||
CapsExtension.class);
|
||||
if (capsExtension == null) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -339,8 +339,7 @@ public final class AccountManager extends Manager {
|
|||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
XMPPConnection connection = connection();
|
||||
|
||||
ExtensionElement extensionElement = connection.getFeature(Registration.Feature.ELEMENT,
|
||||
Registration.Feature.NAMESPACE);
|
||||
ExtensionElement extensionElement = connection.getFeature(Registration.Feature.class);
|
||||
if (extensionElement != null) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,8 @@ package org.jivesoftware.smackx.iqregister.packet;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.packet.IQ;
|
||||
|
||||
|
@ -104,6 +106,8 @@ public class Registration extends IQ {
|
|||
|
||||
public static final String ELEMENT = "register";
|
||||
public static final String NAMESPACE = "http://jabber.org/features/iq-register";
|
||||
public static final QName QNAME = new QName(NAMESPACE, ELEMENT);
|
||||
|
||||
public static final Feature INSTANCE = new Registration.Feature();
|
||||
|
||||
private Feature() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue