1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-09 00:59:39 +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

@ -797,7 +797,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
return;
}
Compress.Feature compression = getFeature(Compress.Feature.ELEMENT, Compress.NAMESPACE);
Compress.Feature compression = getFeature(Compress.Feature.class);
if (compression == null) {
// Server does not support compression
return;
@ -853,7 +853,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
@Override
protected void afterFeaturesReceived() throws NotConnectedException, InterruptedException, SecurityRequiredByServerException {
StartTls startTlsFeature = getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
StartTls startTlsFeature = getFeature(StartTls.class);
if (startTlsFeature != null) {
if (startTlsFeature.required() && config.getSecurityMode() == SecurityMode.disabled) {
SecurityRequiredByServerException smackException = new SecurityRequiredByServerException();

View file

@ -819,7 +819,7 @@ public class XmppTcpTransportModule extends ModularXmppClientToServerConnectionM
@Override
public StateTransitionResult.TransitionImpossible isTransitionToPossible(WalkStateGraphContext walkStateGraphContext)
throws SecurityRequiredByClientException, SecurityRequiredByServerException {
StartTls startTlsFeature = connectionInternal.connection.getFeature(StartTls.ELEMENT, StartTls.NAMESPACE);
StartTls startTlsFeature = connectionInternal.connection.getFeature(StartTls.class);
SecurityMode securityMode = connectionInternal.connection.getConfiguration().getSecurityMode();
switch (securityMode) {