Add voice broadcast permissions (#9284)
* Add Voice Broadcast labs setting and composer button * Implement strict typing * Extend MessageComposer-test * Extend tests * Revert some strict type fixex * Implement voice broadcast permissions * Update variable casing
This commit is contained in:
parent
cb735c9439
commit
0cc4f4e1bc
10 changed files with 123 additions and 3 deletions
|
@ -79,6 +79,7 @@ interface IProps {
|
|||
relation?: IEventRelation;
|
||||
e2eStatus?: E2EStatus;
|
||||
compact?: boolean;
|
||||
showVoiceBroadcastButton?: boolean;
|
||||
}
|
||||
|
||||
interface IState {
|
||||
|
@ -107,6 +108,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||
|
||||
public static defaultProps = {
|
||||
compact: false,
|
||||
showVoiceBroadcastButton: false,
|
||||
};
|
||||
|
||||
public constructor(props: IProps) {
|
||||
|
@ -368,6 +370,10 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||
return this.state.showStickersButton && !isLocalRoom(this.props.room);
|
||||
}
|
||||
|
||||
private get showVoiceBroadcastButton(): boolean {
|
||||
return this.props.showVoiceBroadcastButton && this.state.showVoiceBroadcastButton;
|
||||
}
|
||||
|
||||
public render() {
|
||||
const controls = [
|
||||
this.props.e2eStatus ?
|
||||
|
@ -495,7 +501,7 @@ export default class MessageComposer extends React.Component<IProps, IState> {
|
|||
showPollsButton={this.state.showPollsButton}
|
||||
showStickersButton={this.showStickersButton}
|
||||
toggleButtonMenu={this.toggleButtonMenu}
|
||||
showVoiceBroadcastButton={this.state.showVoiceBroadcastButton}
|
||||
showVoiceBroadcastButton={this.showVoiceBroadcastButton}
|
||||
onStartVoiceBroadcastClick={() => {
|
||||
// Sends a voice message. To be replaced by voice broadcast during development.
|
||||
this.voiceRecordingButton.current?.onRecordStartEndClick();
|
||||
|
|
|
@ -30,6 +30,7 @@ import ErrorDialog from '../../../dialogs/ErrorDialog';
|
|||
import PowerSelector from "../../../elements/PowerSelector";
|
||||
import SettingsFieldset from '../../SettingsFieldset';
|
||||
import SettingsStore from "../../../../../settings/SettingsStore";
|
||||
import { VoiceBroadcastInfoEventType } from '../../../../../voice-broadcast';
|
||||
|
||||
interface IEventShowOpts {
|
||||
isState?: boolean;
|
||||
|
@ -61,6 +62,7 @@ const plEventsToShow: Record<string, IEventShowOpts> = {
|
|||
|
||||
// TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111)
|
||||
"im.vector.modular.widgets": { isState: true, hideForSpace: true },
|
||||
[VoiceBroadcastInfoEventType]: { isState: true, hideForSpace: true },
|
||||
};
|
||||
|
||||
// parse a string as an integer; if the input is undefined, or cannot be parsed
|
||||
|
@ -244,6 +246,7 @@ export default class RolesRoomSettingsTab extends React.Component<IProps> {
|
|||
|
||||
// TODO: Enable support for m.widget event type (https://github.com/vector-im/element-web/issues/13111)
|
||||
"im.vector.modular.widgets": isSpaceRoom ? null : _td("Modify widgets"),
|
||||
[VoiceBroadcastInfoEventType]: _td("Voice broadcasts"),
|
||||
};
|
||||
|
||||
if (SettingsStore.getValue("feature_pinning")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue