mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-08 22:21:08 +01:00
Rename 'serviceName' to 'xmppServiceDomain'
Also use 'null' as default value for the resource, to enforce server generated resources. Fixes Smack-665
This commit is contained in:
parent
0c8199650b
commit
f369a009ac
38 changed files with 116 additions and 104 deletions
|
|
@ -74,7 +74,7 @@ public class AMPManager {
|
|||
* @return a boolean indicating if the AMP support is enabled for the given connection
|
||||
*/
|
||||
public static boolean isServiceEnabled(XMPPConnection connection) {
|
||||
connection.getServiceName();
|
||||
connection.getXMPPServiceDomain();
|
||||
return ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(AMPExtension.NAMESPACE);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -552,7 +552,7 @@ public final class Socks5BytestreamManager implements BytestreamManager {
|
|||
List<Jid> proxies = new ArrayList<>();
|
||||
|
||||
// get all items from XMPP server
|
||||
DiscoverItems discoverItems = serviceDiscoveryManager.discoverItems(this.connection.getServiceName());
|
||||
DiscoverItems discoverItems = serviceDiscoveryManager.discoverItems(this.connection.getXMPPServiceDomain());
|
||||
|
||||
// query all items if they are SOCKS5 proxies
|
||||
for (Item item : discoverItems.getItems()) {
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ public final class EntityCapsManager extends Manager {
|
|||
if (capsExtension == null) {
|
||||
return;
|
||||
}
|
||||
DomainBareJid from = connection.getServiceName();
|
||||
DomainBareJid from = connection.getXMPPServiceDomain();
|
||||
addCapsExtensionInfo(from, capsExtension);
|
||||
}
|
||||
});
|
||||
|
|
@ -456,7 +456,7 @@ public final class EntityCapsManager extends Manager {
|
|||
* @throws InterruptedException
|
||||
*/
|
||||
public boolean areEntityCapsSupportedByServer() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
return areEntityCapsSupported(connection().getServiceName());
|
||||
return areEntityCapsSupported(connection().getXMPPServiceDomain());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -661,7 +661,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
*/
|
||||
public boolean serverSupportsFeature(String feature) throws NoResponseException, XMPPErrorException,
|
||||
NotConnectedException, InterruptedException {
|
||||
return supportsFeature(connection().getServiceName(), feature);
|
||||
return supportsFeature(connection().getXMPPServiceDomain(), feature);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -702,7 +702,7 @@ public final class ServiceDiscoveryManager extends Manager {
|
|||
public List<DiscoverInfo> findServicesDiscoverInfo(String feature, boolean stopOnFirst, boolean useCache)
|
||||
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
List<DiscoverInfo> serviceDiscoInfo = null;
|
||||
DomainBareJid serviceName = connection().getServiceName();
|
||||
DomainBareJid serviceName = connection().getXMPPServiceDomain();
|
||||
if (useCache) {
|
||||
serviceDiscoInfo = services.get(feature);
|
||||
if (serviceDiscoInfo != null) {
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ public final class AccountManager extends Manager {
|
|||
attributes.put("password", password);
|
||||
Registration reg = new Registration(attributes);
|
||||
reg.setType(IQ.Type.set);
|
||||
reg.setTo(connection().getServiceName());
|
||||
reg.setTo(connection().getXMPPServiceDomain());
|
||||
createPacketCollectorAndSend(reg).nextResultOrThrow();
|
||||
}
|
||||
|
||||
|
|
@ -299,7 +299,7 @@ public final class AccountManager extends Manager {
|
|||
map.put("password",newPassword);
|
||||
Registration reg = new Registration(map);
|
||||
reg.setType(IQ.Type.set);
|
||||
reg.setTo(connection().getServiceName());
|
||||
reg.setTo(connection().getXMPPServiceDomain());
|
||||
createPacketCollectorAndSend(reg).nextResultOrThrow();
|
||||
}
|
||||
|
||||
|
|
@ -320,7 +320,7 @@ public final class AccountManager extends Manager {
|
|||
attributes.put("remove", "");
|
||||
Registration reg = new Registration(attributes);
|
||||
reg.setType(IQ.Type.set);
|
||||
reg.setTo(connection().getServiceName());
|
||||
reg.setTo(connection().getXMPPServiceDomain());
|
||||
createPacketCollectorAndSend(reg).nextResultOrThrow();
|
||||
}
|
||||
|
||||
|
|
@ -336,7 +336,7 @@ public final class AccountManager extends Manager {
|
|||
*/
|
||||
private synchronized void getRegistrationInfo() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
Registration reg = new Registration();
|
||||
reg.setTo(connection().getServiceName());
|
||||
reg.setTo(connection().getXMPPServiceDomain());
|
||||
info = createPacketCollectorAndSend(reg).nextResultOrThrow();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public abstract class MultiUserChatException extends SmackException {
|
|||
|
||||
/**
|
||||
* Thrown when trying to enter a MUC room that is not hosted a domain providing a MUC service.
|
||||
* Try {@link MultiUserChatManager#getServiceNames()} for a list of client-local domains
|
||||
* Try {@link MultiUserChatManager#getXMPPServiceDomains()} for a list of client-local domains
|
||||
* providing a MUC service.
|
||||
*/
|
||||
public static class NotAMucServiceException extends MultiUserChatException {
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ public final class MultiUserChatManager extends Manager {
|
|||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public List<DomainBareJid> getServiceNames() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
public List<DomainBareJid> getXMPPServiceDomains() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
|
||||
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection());
|
||||
return sdm.findServices(MUCInitialPresence.NAMESPACE, false, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ public final class PingManager extends Manager {
|
|||
connection.createPacketCollectorAndSend(ping).nextResultOrThrow(pingTimeout);
|
||||
}
|
||||
catch (XMPPException exc) {
|
||||
return jid.equals(connection.getServiceName());
|
||||
return jid.equals(connection.getXMPPServiceDomain());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -250,7 +250,7 @@ public final class PingManager extends Manager {
|
|||
public boolean pingMyServer(boolean notifyListeners, long pingTimeout) throws NotConnectedException, InterruptedException {
|
||||
boolean res;
|
||||
try {
|
||||
res = ping(connection().getServiceName(), pingTimeout);
|
||||
res = ping(connection().getXMPPServiceDomain(), pingTimeout);
|
||||
}
|
||||
catch (NoResponseException e) {
|
||||
res = false;
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public final class PubSubManager extends Manager {
|
|||
if (pubSubService == null) {
|
||||
try {
|
||||
// Perform an educated guess about what the PubSub service's domain bare JID may be
|
||||
pubSubService = JidCreate.domainBareFrom("pubsub." + connection.getServiceName());
|
||||
pubSubService = JidCreate.domainBareFrom("pubsub." + connection.getXMPPServiceDomain());
|
||||
}
|
||||
catch (XmppStringprepException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue