[glitch-port]: Adds deleting others notice if you have the rights(~moderator)
This commit is contained in:
parent
60ec5e712c
commit
91ad1d0001
2 changed files with 7 additions and 1 deletions
|
@ -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, isStaff, deleteOthersNotice } from 'flavours/glitch/util/initial_state';
|
||||
import RelativeTimestamp from './relative_timestamp';
|
||||
import { accountAdminLink, statusAdminLink } from 'flavours/glitch/util/backend_links';
|
||||
|
||||
|
@ -204,6 +204,9 @@ export default class StatusActionBar extends ImmutablePureComponent {
|
|||
});
|
||||
}
|
||||
}
|
||||
if ( deleteOthersNotice ) {
|
||||
menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });
|
||||
}
|
||||
}
|
||||
|
||||
if (status.get('in_reply_to_id', null) === null) {
|
||||
|
|
|
@ -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');
|
||||
|
@ -30,4 +31,6 @@ export const mascot = getMeta('mascot');
|
|||
//@TODO: Look if possible to reuse for AdminAPI
|
||||
export const isStaff = getMeta('is_staff');
|
||||
|
||||
export const deleteOthersNotice = getRight('delete_others_notice');
|
||||
|
||||
export default initialState;
|
||||
|
|
Loading…
Reference in a new issue