Skip to content

Commit

Permalink
fix: Allow disable/enable jitsi for a space - EXO-70569
Browse files Browse the repository at this point in the history
Befor this fix, it was not possible to disable jitsi for a space
This commit add the feature
  • Loading branch information
rdenarie committed Apr 12, 2024
1 parent 72dd81d commit 1eaf4d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
Expand All @@ -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
Expand Down Expand Up @@ -87,7 +90,7 @@ public List<ActiveCallProvider> getActiveProvidersForSpace(String spaceId) {
List<ExternalVisioConnector> 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();
}

Expand All @@ -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();
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


<template>
<div class="width-auto d-flex flex-row">
<div>
<v-tooltip
bottom
:disabled="!displayTooltip">
Expand Down

0 comments on commit 1eaf4d0

Please sign in to comment.