|
|
|
@ -9,7 +9,7 @@ import { me } from 'flavours/glitch/initial_state';
|
|
|
|
|
import RelativeTimestamp from './relative_timestamp';
|
|
|
|
|
import { accountAdminLink, statusAdminLink } from 'flavours/glitch/utils/backend_links';
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
import { PERMISSION_MANAGE_USERS } from 'flavours/glitch/permissions';
|
|
|
|
|
import { PERMISSION_MANAGE_USERS, PERMISSION_MANAGE_FEDERATION } from 'flavours/glitch/permissions';
|
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
|
|
|
@ -38,6 +38,7 @@ const messages = defineMessages({
|
|
|
|
|
embed: { id: 'status.embed', defaultMessage: 'Embed' },
|
|
|
|
|
admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },
|
|
|
|
|
admin_status: { id: 'status.admin_status', defaultMessage: 'Open this post in the moderation interface' },
|
|
|
|
|
admin_domain: { id: 'status.admin_domain', defaultMessage: 'Open moderation interface for {domain}' },
|
|
|
|
|
copy: { id: 'status.copy', defaultMessage: 'Copy link to post' },
|
|
|
|
|
hide: { id: 'status.hide', defaultMessage: 'Hide post' },
|
|
|
|
|
edited: { id: 'status.edited', defaultMessage: 'Edited {date}' },
|
|
|
|
@ -197,6 +198,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
|
const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props;
|
|
|
|
|
const { permissions } = this.context.identity;
|
|
|
|
|
|
|
|
|
|
const anonymousAccess = !me;
|
|
|
|
|
const mutingConversation = status.get('muted');
|
|
|
|
@ -252,19 +254,19 @@ class StatusActionBar extends ImmutablePureComponent {
|
|
|
|
|
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 ((this.context.identity.permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS && (accountAdminLink || statusAdminLink)) {
|
|
|
|
|
if (((permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS && (accountAdminLink || statusAdminLink)) || (isRemote && (permissions & PERMISSION_MANAGE_FEDERATION) === PERMISSION_MANAGE_FEDERATION)) {
|
|
|
|
|
menu.push(null);
|
|
|
|
|
if (accountAdminLink !== undefined) {
|
|
|
|
|
menu.push({
|
|
|
|
|
text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }),
|
|
|
|
|
href: accountAdminLink(status.getIn(['account', 'id'])),
|
|
|
|
|
});
|
|
|
|
|
if ((permissions & PERMISSION_MANAGE_USERS) === PERMISSION_MANAGE_USERS) {
|
|
|
|
|
if (accountAdminLink !== undefined) {
|
|
|
|
|
menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: accountAdminLink(status.getIn(['account', 'id'])) });
|
|
|
|
|
}
|
|
|
|
|
if (statusAdminLink !== undefined) {
|
|
|
|
|
menu.push({ text: intl.formatMessage(messages.admin_status), href: statusAdminLink(status.getIn(['account', 'id']), status.get('id')) });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (statusAdminLink !== undefined) {
|
|
|
|
|
menu.push({
|
|
|
|
|
text: intl.formatMessage(messages.admin_status),
|
|
|
|
|
href: statusAdminLink(status.getIn(['account', 'id']), status.get('id')),
|
|
|
|
|
});
|
|
|
|
|
if (isRemote && (permissions & PERMISSION_MANAGE_FEDERATION) === PERMISSION_MANAGE_FEDERATION) {
|
|
|
|
|
const domain = status.getIn(['account', 'acct']).split('@')[1];
|
|
|
|
|
menu.push({ text: intl.formatMessage(messages.admin_domain, { domain: domain }), href: `/admin/instances/${domain}` });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|