1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-14 00:51:19 +01:00

Use Jid (and subclasses) from jxmpp-jid

Fixes SMACK-634
This commit is contained in:
Florian Schmaus 2015-02-14 17:15:02 +01:00
parent 0ee2d9ed1e
commit 5bb4727c57
180 changed files with 1510 additions and 1032 deletions

View file

@ -35,6 +35,7 @@ import org.jivesoftware.smack.packet.XMPPError;
import org.jivesoftware.smack.packet.XMPPError.Condition;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.iqversion.packet.Version;
import org.jxmpp.jid.Jid;
/**
* A Version Manager that automatically responds to version IQs with a predetermined reply.
@ -123,7 +124,7 @@ public class VersionManager extends Manager {
ourVersion = null;
}
public boolean isSupported(String jid) throws NoResponseException, XMPPErrorException,
public boolean isSupported(Jid jid) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException {
return ServiceDiscoveryManager.getInstanceFor(connection()).supportsFeature(jid,
Version.NAMESPACE);
@ -139,7 +140,7 @@ public class VersionManager extends Manager {
* @throws NotConnectedException
* @throws InterruptedException
*/
public Version getVersion(String jid) throws NoResponseException, XMPPErrorException,
public Version getVersion(Jid jid) throws NoResponseException, XMPPErrorException,
NotConnectedException, InterruptedException {
if (!isSupported(jid)) {
return null;

View file

@ -21,6 +21,7 @@ package org.jivesoftware.smackx.iqversion.packet;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.StringUtils;
import org.jxmpp.jid.Jid;
/**
* A Version IQ packet, which is used by XMPP clients to discover version information
@ -68,7 +69,7 @@ public class Version extends IQ {
*
* @param to the jid where to request version from
*/
public Version(String to) {
public Version(Jid to) {
this();
setTo(to);
}