From 444ac6d6e9e6947c600a5922c52d25f5d2efdca8 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 30 May 2022 17:10:13 +0200 Subject: [PATCH] [Glitch] Remove unnused otherAccounts property Port 2f6416db53fd987b702969afa0de69a06caf0d27 to glitch-soc + other related cleanup Signed-off-by: Claire --- .../flavours/glitch/components/status.js | 5 -- .../glitch/components/status_action_bar.js | 40 ++++++------ .../glitch/components/status_header.js | 65 +++++++------------ .../glitch/components/status_icons.js | 4 +- 4 files changed, 43 insertions(+), 71 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 2201cb3822..8a5fda6764 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -67,7 +67,6 @@ class Status extends ImmutablePureComponent { containerId: PropTypes.string, id: PropTypes.string, status: ImmutablePropTypes.map, - otherAccounts: ImmutablePropTypes.list, account: ImmutablePropTypes.map, onReply: PropTypes.func, onFavourite: PropTypes.func, @@ -492,7 +491,6 @@ class Status extends ImmutablePureComponent { intl, status, account, - otherAccounts, settings, collapsed, muted, @@ -745,7 +743,6 @@ class Status extends ImmutablePureComponent { friend={account} collapsed={isCollapsed} parseClick={parseClick} - otherAccounts={otherAccounts} /> ) : null} @@ -755,7 +752,6 @@ class Status extends ImmutablePureComponent { collapsible={settings.getIn(['collapsed', 'enabled'])} collapsed={isCollapsed} setCollapsed={setCollapsed} - directMessage={!!otherAccounts} settings={settings.get('status_icons')} /> @@ -776,7 +772,6 @@ class Status extends ImmutablePureComponent { status={status} account={status.get('account')} showReplyCount={settings.get('show_reply_count')} - directMessage={!!otherAccounts} onFilter={this.handleFilterClick} /> ) : null} diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 68d93cd671..0a5c5b69d4 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -67,7 +67,6 @@ class StatusActionBar extends ImmutablePureComponent { onFilter: PropTypes.func, withDismiss: PropTypes.bool, showReplyCount: PropTypes.bool, - directMessage: PropTypes.bool, scrollKey: PropTypes.string, intl: PropTypes.object.isRequired, }; @@ -197,7 +196,7 @@ class StatusActionBar extends ImmutablePureComponent { } render () { - const { status, intl, withDismiss, showReplyCount, directMessage, scrollKey } = this.props; + const { status, intl, withDismiss, showReplyCount, scrollKey } = this.props; const anonymousAccess = !me; const mutingConversation = status.get('muted'); @@ -311,25 +310,24 @@ class StatusActionBar extends ImmutablePureComponent { return (
{replyButton} - {!directMessage && [ - , - , - shareButton, - , - filterButton, -
- -
, - ]} + + + {shareButton} + + {filterButton} + +
+ +
{status.get('edited_at') && *} diff --git a/app/javascript/flavours/glitch/components/status_header.js b/app/javascript/flavours/glitch/components/status_header.js index cc476139bf..990dea5362 100644 --- a/app/javascript/flavours/glitch/components/status_header.js +++ b/app/javascript/flavours/glitch/components/status_header.js @@ -15,7 +15,6 @@ export default class StatusHeader extends React.PureComponent { status: ImmutablePropTypes.map.isRequired, friend: ImmutablePropTypes.map, parseClick: PropTypes.func.isRequired, - otherAccounts: ImmutablePropTypes.list, }; // Handles clicks on account name/image @@ -34,57 +33,39 @@ export default class StatusHeader extends React.PureComponent { const { status, friend, - otherAccounts, } = this.props; const account = status.get('account'); let statusAvatar; - if (otherAccounts && otherAccounts.size > 0) { - statusAvatar = ; - } else if (friend === undefined || friend === null) { + if (friend === undefined || friend === null) { statusAvatar = ; } else { statusAvatar = ; } - if (!otherAccounts) { - return ( - - ); - } else { - // This is a DM conversation - return ( -
- - {statusAvatar} - - - - - -
- ); - } + return ( + + ); } } diff --git a/app/javascript/flavours/glitch/components/status_icons.js b/app/javascript/flavours/glitch/components/status_icons.js index b701c4eeba..2226aaef2b 100644 --- a/app/javascript/flavours/glitch/components/status_icons.js +++ b/app/javascript/flavours/glitch/components/status_icons.js @@ -48,7 +48,6 @@ class StatusIcons extends React.PureComponent { mediaIcons: PropTypes.arrayOf(PropTypes.string), collapsible: PropTypes.bool, collapsed: PropTypes.bool, - directMessage: PropTypes.bool, setCollapsed: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, settings: ImmutablePropTypes.map.isRequired, @@ -100,7 +99,6 @@ class StatusIcons extends React.PureComponent { mediaIcons, collapsible, collapsed, - directMessage, settings, intl, } = this.props; @@ -125,7 +123,7 @@ class StatusIcons extends React.PureComponent { title={intl.formatMessage(messages.localOnly)} />} {settings.get('media') && !!mediaIcons && mediaIcons.map(icon => this.renderIcon(icon))} - {settings.get('visibility') && !directMessage && } + {settings.get('visibility') && } {collapsible && (