Skip to content
Snippets Groups Projects
Commit 869e7901 authored by Larbi Gharib's avatar Larbi Gharib
Browse files

Public in calls option

Change-Id: Ic54daeeb89df2cb2c315520801656e5637a29be6
parent 39ded013
No related branches found
No related tags found
No related merge requests found
...@@ -41,8 +41,7 @@ public class DeviceRegistrationResponse { ...@@ -41,8 +41,7 @@ public class DeviceRegistrationResponse {
private String receiptSignature; private String receiptSignature;
private String userPhoto; private String userPhoto;
//Backward compatibility fix so all the fields are included here. //Backward compatibility fix so all the fields are included here.
private Boolean allowCertFromHistory; private Boolean publicInCalls;
private Boolean allowCertFromTrusted;
private Boolean proxyEnabled; private Boolean proxyEnabled;
private String dhtProxyListUrl; private String dhtProxyListUrl;
private String proxyServer; private String proxyServer;
...@@ -53,7 +52,6 @@ public class DeviceRegistrationResponse { ...@@ -53,7 +52,6 @@ public class DeviceRegistrationResponse {
private String turnServerPassword; private String turnServerPassword;
private Boolean videoEnabled; private Boolean videoEnabled;
private Boolean turnEnabled; private Boolean turnEnabled;
private Boolean allowCertFromContact;
private Boolean accountDiscovery; private Boolean accountDiscovery;
private Boolean peerDiscovery; private Boolean peerDiscovery;
private Boolean upnpEnabled; private Boolean upnpEnabled;
...@@ -71,8 +69,7 @@ public class DeviceRegistrationResponse { ...@@ -71,8 +69,7 @@ public class DeviceRegistrationResponse {
public void setPolicyData(String policyData){ public void setPolicyData(String policyData){
PolicyData policy = JsonIterator.deserialize(policyData,PolicyData.class); PolicyData policy = JsonIterator.deserialize(policyData,PolicyData.class);
this.allowCertFromHistory = policy.getAllowCertFromHistory(); this.publicInCalls = policy.getPublicInCalls();
this.allowCertFromTrusted = policy.getAllowCertFromTrusted();
this.proxyEnabled = policy.getProxyEnabled(); this.proxyEnabled = policy.getProxyEnabled();
this.dhtProxyListUrl = policy.getDhtProxyListUrl(); this.dhtProxyListUrl = policy.getDhtProxyListUrl();
this.proxyServer = policy.getProxyServer(); this.proxyServer = policy.getProxyServer();
...@@ -83,7 +80,6 @@ public class DeviceRegistrationResponse { ...@@ -83,7 +80,6 @@ public class DeviceRegistrationResponse {
this.turnServerPassword = policy.getTurnServerPassword(); this.turnServerPassword = policy.getTurnServerPassword();
this.videoEnabled = policy.getVideoEnabled(); this.videoEnabled = policy.getVideoEnabled();
this.turnEnabled = policy.getTurnEnabled(); this.turnEnabled = policy.getTurnEnabled();
this.allowCertFromContact = policy.getAllowCertFromContact();
this.accountDiscovery = policy.getAccountDiscovery(); this.accountDiscovery = policy.getAccountDiscovery();
this.peerDiscovery = policy.getPeerDiscovery(); this.peerDiscovery = policy.getPeerDiscovery();
this.upnpEnabled = policy.getUpnpEnabled(); this.upnpEnabled = policy.getUpnpEnabled();
......
...@@ -7,8 +7,7 @@ import lombok.Setter; ...@@ -7,8 +7,7 @@ import lombok.Setter;
@Setter @Setter
public class PolicyData { public class PolicyData {
private Boolean allowCertFromHistory; private Boolean publicInCalls;
private Boolean allowCertFromTrusted;
private Boolean proxyEnabled; private Boolean proxyEnabled;
private String dhtProxyListUrl; private String dhtProxyListUrl;
private String proxyServer; private String proxyServer;
...@@ -19,7 +18,6 @@ public class PolicyData { ...@@ -19,7 +18,6 @@ public class PolicyData {
private String turnServerPassword; private String turnServerPassword;
private Boolean videoEnabled; private Boolean videoEnabled;
private Boolean turnEnabled; private Boolean turnEnabled;
private Boolean allowCertFromContact;
private Boolean accountDiscovery; private Boolean accountDiscovery;
private Boolean peerDiscovery; private Boolean peerDiscovery;
private Boolean upnpEnabled; private Boolean upnpEnabled;
......
...@@ -171,7 +171,7 @@ export default function EditBlueprintConfiguration(props) { ...@@ -171,7 +171,7 @@ export default function EditBlueprintConfiguration(props) {
const history = useHistory(); const history = useHistory();
const [videoEnabled, setVideoEnabled] = React.useState(true); const [videoEnabled, setVideoEnabled] = React.useState(true);
const [allowCertFromContact, setAllowCertFromContact] = React.useState(true); const [publicInCalls, setPublicInCalls] = React.useState(true);
const [autoAnswer, setAutoAnswer] = React.useState(false); const [autoAnswer, setAutoAnswer] = React.useState(false);
const [peerDiscovery, setPeerDiscovery] = React.useState(true); const [peerDiscovery, setPeerDiscovery] = React.useState(true);
const [rendezVous, setRendezVous] = React.useState(false); const [rendezVous, setRendezVous] = React.useState(false);
...@@ -209,7 +209,7 @@ export default function EditBlueprintConfiguration(props) { ...@@ -209,7 +209,7 @@ export default function EditBlueprintConfiguration(props) {
.then((response) => { .then((response) => {
let policyData = JSON.parse(response.data.policyData); let policyData = JSON.parse(response.data.policyData);
setVideoEnabled(policyData["videoEnabled"]); setVideoEnabled(policyData["videoEnabled"]);
setAllowCertFromContact(policyData["allowCertFromContact"]); setPublicInCalls(policyData["publicInCalls"]);
setAutoAnswer(policyData["autoAnswer"]); setAutoAnswer(policyData["autoAnswer"]);
setPeerDiscovery(policyData["peerDiscovery"]); setPeerDiscovery(policyData["peerDiscovery"]);
setRendezVous(policyData["rendezVous"]); setRendezVous(policyData["rendezVous"]);
...@@ -252,9 +252,7 @@ export default function EditBlueprintConfiguration(props) { ...@@ -252,9 +252,7 @@ export default function EditBlueprintConfiguration(props) {
const handleUpdateConfiguration = (field, value, selectedOptions = []) => { const handleUpdateConfiguration = (field, value, selectedOptions = []) => {
let data = { let data = {
videoEnabled: videoEnabled, videoEnabled: videoEnabled,
allowCertFromContact: allowCertFromContact, publicInCalls: publicInCalls,
allowCertFromHistory: allowCertFromContact,
allowCertFromTrusted: allowCertFromContact,
autoAnswer: autoAnswer, autoAnswer: autoAnswer,
peerDiscovery: peerDiscovery, peerDiscovery: peerDiscovery,
accountDiscovery: peerDiscovery, accountDiscovery: peerDiscovery,
......
...@@ -94,7 +94,7 @@ export default function EditBlueprintPermissions(props) { ...@@ -94,7 +94,7 @@ export default function EditBlueprintPermissions(props) {
const history = useHistory(); const history = useHistory();
const [videoEnabled, setVideoEnabled] = React.useState(true); const [videoEnabled, setVideoEnabled] = React.useState(true);
const [allowCertFromContact, setAllowCertFromContact] = React.useState(true); const [publicInCalls, setPublicInCalls] = React.useState(true);
const [autoAnswer, setAutoAnswer] = React.useState(false); const [autoAnswer, setAutoAnswer] = React.useState(false);
const [peerDiscovery, setPeerDiscovery] = React.useState(true); const [peerDiscovery, setPeerDiscovery] = React.useState(true);
const [rendezVous, setRendezVous] = React.useState(false); const [rendezVous, setRendezVous] = React.useState(false);
...@@ -124,7 +124,7 @@ export default function EditBlueprintPermissions(props) { ...@@ -124,7 +124,7 @@ export default function EditBlueprintPermissions(props) {
.then((response) => { .then((response) => {
let policyData = JSON.parse(response.data.policyData); let policyData = JSON.parse(response.data.policyData);
setVideoEnabled(policyData["videoEnabled"]); setVideoEnabled(policyData["videoEnabled"]);
setAllowCertFromContact(policyData["allowCertFromContact"]); setPublicInCalls(policyData["publicInCalls"]);
setAutoAnswer(policyData["autoAnswer"]); setAutoAnswer(policyData["autoAnswer"]);
setPeerDiscovery(policyData["peerDiscovery"]); setPeerDiscovery(policyData["peerDiscovery"]);
setRendezVous(policyData["rendezVous"]); setRendezVous(policyData["rendezVous"]);
...@@ -151,9 +151,7 @@ export default function EditBlueprintPermissions(props) { ...@@ -151,9 +151,7 @@ export default function EditBlueprintPermissions(props) {
const handleUpdatePermissions = (field, value) => { const handleUpdatePermissions = (field, value) => {
let data = { let data = {
videoEnabled: videoEnabled, videoEnabled: videoEnabled,
allowCertFromContact: allowCertFromContact, publicInCalls: publicInCalls,
allowCertFromHistory: allowCertFromContact,
allowCertFromTrusted: allowCertFromContact,
autoAnswer: autoAnswer, autoAnswer: autoAnswer,
peerDiscovery: peerDiscovery, peerDiscovery: peerDiscovery,
accountDiscovery: peerDiscovery, accountDiscovery: peerDiscovery,
...@@ -169,11 +167,7 @@ export default function EditBlueprintPermissions(props) { ...@@ -169,11 +167,7 @@ export default function EditBlueprintPermissions(props) {
dhtProxyListUrl: dhtProxyListUrl, dhtProxyListUrl: dhtProxyListUrl,
}; };
if (field === "allowCertFromContact") { if (field === "peerDiscovery") {
data.allowCertFromContact = value;
data.allowCertFromHistory = value;
data.allowCertFromTrusted = value;
} else if (field === "peerDiscovery") {
data.peerDiscovery = value; data.peerDiscovery = value;
data.accountDiscovery = value; data.accountDiscovery = value;
data.accountPublish = value; data.accountPublish = value;
...@@ -270,19 +264,19 @@ export default function EditBlueprintPermissions(props) { ...@@ -270,19 +264,19 @@ export default function EditBlueprintPermissions(props) {
<FormControlLabel <FormControlLabel
control={ control={
<Checkbox <Checkbox
checked={allowCertFromContact} checked={publicInCalls}
color="primary" color="primary"
onChange={(e) => { onChange={(e) => {
setAllowCertFromContact(e.target.checked); setPublicInCalls(e.target.checked);
handleUpdatePermissions( handleUpdatePermissions(
"allowCertFromContact", "publicInCalls",
e.target.checked e.target.checked
); );
}} }}
name="allowCertFromContact" name="publicInCalls"
/> />
} }
label="Allow incomming calls from unknown contacts" label="Allow incoming calls from unknown contacts"
/> />
</FormGroup> </FormGroup>
<FormGroup row> <FormGroup row>
......
...@@ -130,17 +130,9 @@ public class DeviceServlet extends HttpServlet { ...@@ -130,17 +130,9 @@ public class DeviceServlet extends HttpServlet {
obj.remove("videoEnabled"); obj.remove("videoEnabled");
} }
if (obj.get("allowCertFromContact") != null) { if (obj.get("publicInCalls") != null) {
obj.add("Account.allowCertFromContact", obj.get("allowCertFromContact")); obj.add("DHT.PublicInCalls", obj.get("publicInCalls"));
obj.remove("allowCertFromContact"); obj.remove("publicInCalls");
}
if (obj.get("allowCertFromHistory") != null) {
obj.add("Account.allowCertFromHistory", obj.get("allowCertFromHistory"));
obj.remove("allowCertFromHistory");
}
if (obj.get("allowCertFromTrusted") != null) {
obj.add("Account.allowCertFromTrusted", obj.get("allowCertFromTrusted"));
obj.remove("allowCertFromTrusted");
} }
if (obj.get("autoAnswer") != null) { if (obj.get("autoAnswer") != null) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment