2020-04-16 11:26:44 +00:00
|
|
|
// @flow
|
|
|
|
|
2021-07-09 12:36:19 +00:00
|
|
|
import { SET_EVERYONE_ENABLED_E2EE, SET_EVERYONE_SUPPORT_E2EE, TOGGLE_E2EE } from './actionTypes';
|
2020-04-16 11:26:44 +00:00
|
|
|
|
|
|
|
/**
|
2020-05-07 09:54:02 +00:00
|
|
|
* Dispatches an action to enable / disable E2EE.
|
2020-04-16 11:26:44 +00:00
|
|
|
*
|
2020-05-07 09:54:02 +00:00
|
|
|
* @param {boolean} enabled - Whether E2EE is to be enabled or not.
|
2020-04-16 11:26:44 +00:00
|
|
|
* @returns {Object}
|
|
|
|
*/
|
2020-05-07 09:54:02 +00:00
|
|
|
export function toggleE2EE(enabled: boolean) {
|
2020-04-16 11:26:44 +00:00
|
|
|
return {
|
2020-05-07 09:54:02 +00:00
|
|
|
type: TOGGLE_E2EE,
|
|
|
|
enabled
|
2020-04-16 11:26:44 +00:00
|
|
|
};
|
|
|
|
}
|
2021-07-09 12:36:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set new value whether everyone has E2EE enabled.
|
|
|
|
*
|
|
|
|
* @param {boolean} everyoneEnabledE2EE - The new value.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_EVERYONE_ENABLED_E2EE,
|
|
|
|
* everyoneEnabledE2EE: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setEveryoneEnabledE2EE(everyoneEnabledE2EE: boolean) {
|
|
|
|
return {
|
|
|
|
type: SET_EVERYONE_ENABLED_E2EE,
|
|
|
|
everyoneEnabledE2EE
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set new value whether everyone support E2EE.
|
|
|
|
*
|
|
|
|
* @param {boolean} everyoneSupportE2EE - The new value.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_EVERYONE_SUPPORT_E2EE,
|
|
|
|
* everyoneSupportE2EE: boolean
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setEveryoneSupportE2EE(everyoneSupportE2EE: boolean) {
|
|
|
|
return {
|
|
|
|
type: SET_EVERYONE_SUPPORT_E2EE,
|
|
|
|
everyoneSupportE2EE
|
|
|
|
};
|
|
|
|
}
|