From 3068384dbcfbd2dbe153d88c9d4550efdf9764c0 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Wed, 17 Jan 2018 11:48:30 +0100 Subject: Glitchsoc-specific changes to allow boosting own private toots --- app/javascript/flavours/glitch/components/status_action_bar.js | 5 ++++- .../flavours/glitch/features/status/components/action_bar.js | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 1c38d8877..da6e4e6ba 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -18,6 +18,7 @@ const messages = defineMessages({ more: { id: 'status.more', defaultMessage: 'More' }, replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' }, reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, + reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, @@ -127,6 +128,8 @@ export default class StatusActionBar extends ImmutablePureComponent { const mutingConversation = status.get('muted'); const anonymousAccess = !me; const publicStatus = ['public', 'unlisted'].includes(status.get('visibility')); + const reblogDisabled = anonymousAccess || (status.get('visibility') === 'direct' || (status.get('visibility') === 'private' && me !== status.getIn(['account', 'id']))); + const reblogMessage = status.get('visibility') === 'private' ? messages.reblog_private : messages.reblog; let menu = []; let reblogIcon = 'retweet'; @@ -175,7 +178,7 @@ export default class StatusActionBar extends ImmutablePureComponent { return (
- + {shareButton} diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.js b/app/javascript/flavours/glitch/features/status/components/action_bar.js index 7928c9448..1ea0fa421 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.js @@ -11,6 +11,7 @@ const messages = defineMessages({ mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' }, reply: { id: 'status.reply', defaultMessage: 'Reply' }, reblog: { id: 'status.reblog', defaultMessage: 'Boost' }, + reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' }, cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' }, favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' }, @@ -141,12 +142,13 @@ export default class ActionBar extends React.PureComponent { //if (status.get('visibility') === 'direct') reblogIcon = 'envelope'; // else if (status.get('visibility') === 'private') reblogIcon = 'lock'; - let reblog_disabled = (status.get('visibility') === 'direct' || status.get('visibility') === 'private'); + let reblog_disabled = (status.get('visibility') === 'direct' || (status.get('visibility') === 'private' && me !== status.getIn(['account', 'id']))); + let reblog_message = status.get('visibility') === 'private' ? messages.reblog_private : messages.reblog; return (
-
+
{shareButton}
-- cgit