diff --git a/services/src/main/java/org/exoplatform/webconferencing/externalvisio/ExternalVisioProvider.java b/services/src/main/java/org/exoplatform/webconferencing/externalvisio/ExternalVisioProvider.java index 90ad965..103624c 100644 --- a/services/src/main/java/org/exoplatform/webconferencing/externalvisio/ExternalVisioProvider.java +++ b/services/src/main/java/org/exoplatform/webconferencing/externalvisio/ExternalVisioProvider.java @@ -19,6 +19,7 @@ import org.exoplatform.social.core.identity.model.Identity; import org.exoplatform.social.core.manager.IdentityManager; import org.exoplatform.social.core.space.model.Space; +import org.exoplatform.social.core.space.spi.SpaceService; import org.exoplatform.webconferencing.ActiveCallProvider; import org.exoplatform.webconferencing.CallProvider; import org.exoplatform.webconferencing.CallProviderException; @@ -43,6 +44,7 @@ public class ExternalVisioProvider extends CallProvider { public static final String EXTERNAL_VISIO_TITLE = "ExternalVisio"; private ExternalVisioConnectorService externalVisioConnectorService; + private SpaceService spaceService; private IdentityManager identityManager; /** @@ -51,10 +53,11 @@ public class ExternalVisioProvider extends CallProvider { * @param params the params * @throws ConfigurationException the configuration exception */ - public ExternalVisioProvider(org.exoplatform.container.xml.InitParams params, ExternalVisioConnectorService externalVisioConnectorService, IdentityManager identityManager) throws ConfigurationException { + public ExternalVisioProvider(org.exoplatform.container.xml.InitParams params, ExternalVisioConnectorService externalVisioConnectorService, IdentityManager identityManager, SpaceService spaceService) throws ConfigurationException { super(params); this.externalVisioConnectorService = externalVisioConnectorService; this.identityManager = identityManager; + this.spaceService = spaceService; } @Override @@ -87,7 +90,7 @@ public List getActiveProvidersForSpace(String spaceId) { List externalVisioConnectors = externalVisioConnectorService.getActiveExternalVisioConnectorsForSpace(); return externalVisioConnectors.stream().map(externalVisioConnector -> { - return new ActiveCallProvider(externalVisioConnector.getId().toString(), externalVisioConnector.getName(), null, false); + return new ActiveCallProvider(externalVisioConnector.getId().toString(), externalVisioConnector.getName(), null, false, true); }).toList(); } @@ -96,11 +99,13 @@ public boolean canInvite() { return false; } - public boolean isConfiguredForIdentity(String remoteId) { - Identity identity = identityManager.getOrCreateSpaceIdentity(remoteId); - if (identity == null) { - identity = identityManager.getOrCreateUserIdentity(remoteId); + public boolean isConfiguredForIdentity(String spaceId) { + Space space = spaceService.getSpaceById(spaceId); + if (space!=null) { + Identity identity = identityManager.getOrCreateSpaceIdentity(space.getPrettyName()); + return !externalVisioConnectorService.getConfiguredExternalVisioConnectors(identity).isEmpty(); + } else { + return false; } - return !externalVisioConnectorService.getConfiguredExternalVisioConnectors(identity).isEmpty(); } } diff --git a/webapp/src/main/webapp/vue-app/CallButton/components/VisioConnectorMeetButton.vue b/webapp/src/main/webapp/vue-app/CallButton/components/VisioConnectorMeetButton.vue index 6ee99fe..33cc6c6 100644 --- a/webapp/src/main/webapp/vue-app/CallButton/components/VisioConnectorMeetButton.vue +++ b/webapp/src/main/webapp/vue-app/CallButton/components/VisioConnectorMeetButton.vue @@ -1,7 +1,7 @@