Added ban user right click functionality

pull/652/head
Beaudan Brown 6 years ago
parent 4581a20260
commit a3d171884d

@ -655,6 +655,8 @@
!this.get('isPublic') ||
this.getConversation().isModerator(this.OUR_NUMBER) ||
this.getSource() === this.OUR_NUMBER,
hasModPerms:
this.getConversation().isModerator(this.OUR_NUMBER),
onCopyText: () => this.copyText(),
onSelectMessage: () => this.selectMessage(),

@ -57,6 +57,7 @@ export interface Props {
disableMenu?: boolean;
isModerator?: boolean;
isDeletable: boolean;
hasModPerms?: boolean;
text?: string;
textPending?: boolean;
id?: string;
@ -112,6 +113,7 @@ export interface Props {
onDownload?: (isDangerous: boolean) => void;
onDelete?: () => void;
onCopyPubKey?: () => void;
onBanUser?: () => void;
onShowDetail: () => void;
}
@ -861,6 +863,8 @@ export class Message extends React.PureComponent<Props, State> {
onCopyPubKey,
isPublic,
i18n,
hasModPerms,
onBanUser,
} = this.props;
const showRetry = status === 'error' && direction === 'outgoing';
@ -960,6 +964,11 @@ export class Message extends React.PureComponent<Props, State> {
{i18n('copyPublicKey')}
</MenuItem>
) : null}
{(hasModPerms && isPublic) ? (
<MenuItem onClick={wrap(onBanUser)}>
{i18n('banUser')}
</MenuItem>
) : null}
</ContextMenu>
);
}

Loading…
Cancel
Save