Commit 109aedc3 authored by Haelwenn's avatar Haelwenn

[glitch-port]: Adds deleting others notice if you have the rights(~moderator)

parent bbb9fa98
Pipeline #3737 canceled with stage
......@@ -5,7 +5,7 @@ import IconButton from './icon_button';
import DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { me, isStaff } from 'flavours/glitch/util/initial_state';
import { me, deleteOthersNotice } from 'flavours/glitch/util/initial_state';
import RelativeTimestamp from './relative_timestamp';
const messages = defineMessages({
......@@ -188,10 +188,8 @@ export default class StatusActionBar extends ImmutablePureComponent {
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 (isStaff) {
menu.push(null);
menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });
menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` });
if ( deleteOthersNotice ) {
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
}
}
......
......@@ -10,6 +10,7 @@ const initialState = element && function () {
}();
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');
......@@ -23,4 +24,6 @@ export const searchEnabled = getMeta('search_enabled');
export const maxChars = getMeta('max_toot_chars') || 500;
export const isStaff = false;
export const deleteOthersNotice = getRight('delete_others_notice');
export default initialState;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment