Skip to content
Snippets Groups Projects
Verified Commit 390f4694 authored by Haelwenn's avatar Haelwenn
Browse files

[mastofe] Adds deleting others notice if you have the rights(~moderator)

Closes: #20
parent 8b67152e
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ import IconButton from './icon_button';
import DropdownMenuContainer from '../containers/dropdown_menu_container';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { me } from '../initial_state';
import { me, deleteOthersNotice } from '../initial_state';
const messages = defineMessages({
delete: { id: 'status.delete', defaultMessage: 'Delete' },
......@@ -181,7 +181,9 @@ class StatusActionBar extends ImmutablePureComponent {
menu.push(null);
menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });
menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });
menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });
if ( deleteOthersNotice ) {
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
}
}
if (status.get('visibility') === 'direct') {
......
......@@ -2,6 +2,7 @@ const element = document.getElementById('initial-state');
const initialState = element && JSON.parse(element.textContent);
const getMeta = (prop) => initialState && initialState.meta && initialState.meta[prop];
const getRight = (prop) => initialState && initialState.rights && initialState.rights[prop];
export const reduceMotion = getMeta('reduce_motion');
export const autoPlayGif = getMeta('auto_play_gif');
......@@ -16,4 +17,6 @@ export const invitesEnabled = getMeta('invites_enabled');
export const version = getMeta('version');
export const maxChars = getMeta('max_toot_chars') || getMeta('char_limit') || 5000;
export const deleteOthersNotice = getRight('delete_others_notice');
export default initialState;
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