1
0
Fork 0
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:
Florian Schmaus 2020-07-23 14:32:14 +02:00
parent 91337150e7
commit 329948b442
13 changed files with 78 additions and 18 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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() {