@@ -293,6 +312,9 @@ class Header extends ImmutablePureComponent {
{badge}
@{acct} {lockedIcon}
+
+ {buttons}
+
@@ -352,6 +374,12 @@ class Header extends ImmutablePureComponent {
renderer={counterRenderer('followers')}
/>
+
+ { (me === account.get('id')) && (
+
+ {shortNumberFormat(account.get('subscribing_count'))}
+
+ )}
)}
diff --git a/app/javascript/mastodon/features/account_timeline/components/header.js b/app/javascript/mastodon/features/account_timeline/components/header.js
index 6b52defe4..44f8361f3 100644
--- a/app/javascript/mastodon/features/account_timeline/components/header.js
+++ b/app/javascript/mastodon/features/account_timeline/components/header.js
@@ -13,6 +13,7 @@ export default class Header extends ImmutablePureComponent {
account: ImmutablePropTypes.map,
identity_proofs: ImmutablePropTypes.list,
onFollow: PropTypes.func.isRequired,
+ onSubscribe: PropTypes.func.isRequired,
onBlock: PropTypes.func.isRequired,
onMention: PropTypes.func.isRequired,
onDirect: PropTypes.func.isRequired,
@@ -35,6 +36,10 @@ export default class Header extends ImmutablePureComponent {
this.props.onFollow(this.props.account);
}
+ handleSubscribe = () => {
+ this.props.onSubscribe(this.props.account);
+ }
+
handleBlock = () => {
this.props.onBlock(this.props.account);
}
@@ -106,6 +111,7 @@ export default class Header extends ImmutablePureComponent {
account={account}
identity_proofs={identity_proofs}
onFollow={this.handleFollow}
+ onSubscribe={this.handleSubscribe}
onBlock={this.handleBlock}
onMention={this.handleMention}
onDirect={this.handleDirect}
diff --git a/app/javascript/mastodon/features/account_timeline/containers/header_container.js b/app/javascript/mastodon/features/account_timeline/containers/header_container.js
index e12019547..d6b96eec3 100644
--- a/app/javascript/mastodon/features/account_timeline/containers/header_container.js
+++ b/app/javascript/mastodon/features/account_timeline/containers/header_container.js
@@ -5,6 +5,8 @@ import Header from '../components/header';
import {
followAccount,
unfollowAccount,
+ subscribeAccount,
+ unsubscribeAccount,
unblockAccount,
unmuteAccount,
pinAccount,
@@ -20,11 +22,12 @@ import { initReport } from '../../../actions/reports';
import { openModal } from '../../../actions/modal';
import { blockDomain, unblockDomain } from '../../../actions/domain_blocks';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
-import { unfollowModal } from '../../../initial_state';
+import { unfollowModal, unsubscribeModal } from '../../../initial_state';
import { List as ImmutableList } from 'immutable';
const messages = defineMessages({
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
+ unsubscribeConfirm: { id: 'confirmations.unsubscribe.confirm', defaultMessage: 'Unsubscribe' },
blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },
});
@@ -58,6 +61,22 @@ const mapDispatchToProps = (dispatch, { intl }) => ({
}
},
+ onSubscribe (account) {
+ if (account.getIn(['relationship', 'subscribing'])) {
+ if (unsubscribeModal) {
+ dispatch(openModal('CONFIRM', {
+ message: