From aa494560ae9775e5fc2fb91edf5fabe09e1e049d Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 11 Aug 2020 11:49:15 -0600 Subject: [PATCH 1/5] Beginning works of remote follow based on Pleroma FE version~ --- .../features/account/components/header.js | 29 +++++++++---------- .../features/ui/components/action_button.js | 5 +++- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/app/soapbox/features/account/components/header.js b/app/soapbox/features/account/components/header.js index a26ff710f..467908303 100644 --- a/app/soapbox/features/account/components/header.js +++ b/app/soapbox/features/account/components/header.js @@ -286,22 +286,19 @@ class Header extends ImmutablePureComponent { } - { - me && -
- - {account.get('id') !== me && - - } - -
- } +
+ + {(me && account.get('id') !== me) && + + } + { me && } +
diff --git a/app/soapbox/features/ui/components/action_button.js b/app/soapbox/features/ui/components/action_button.js index b0b114ee6..830ce33a8 100644 --- a/app/soapbox/features/ui/components/action_button.js +++ b/app/soapbox/features/ui/components/action_button.js @@ -16,6 +16,7 @@ import { const messages = defineMessages({ unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, follow: { id: 'account.follow', defaultMessage: 'Follow' }, + remote_follow: { id: 'account.remote_follow', defaultMessage: 'Remote follow' }, requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' }, requested_small: { id: 'account.requested_small', defaultMessage: 'Awaiting approval' }, unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, @@ -83,7 +84,9 @@ class ActionButton extends ImmutablePureComponent { const { account, intl, me, small } = this.props; let actionBtn = null; - if (!account || !me) return actionBtn; + if (!me) { + actionBtn =
- } - - - } +
+ + {me && account.get('id') !== me && account.getIn(['pleroma', 'accepts_chat_messages'], false) === true && + + } + {me && } +
From cdd22a78dd3f231e8693291fa110029188ab5236 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 15 Sep 2020 21:05:39 -0600 Subject: [PATCH 3/5] Add ostatus backend points for development --- webpack/development.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webpack/development.js b/webpack/development.js index 52a47eaa1..ef26e0168 100644 --- a/webpack/development.js +++ b/webpack/development.js @@ -22,6 +22,8 @@ const backendEndpoints = [ '/.well-known/webfinger', '/static', '/emoji', + '/main/ostatus', + '/ostatus_subscribe', ]; const makeProxyConfig = () => { From 6afb91e315d920e96402d48a9925e608be267b16 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 15 Sep 2020 21:09:44 -0600 Subject: [PATCH 4/5] Add OStatus entry points --- app/soapbox/service_worker/entry.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/service_worker/entry.js b/app/soapbox/service_worker/entry.js index 0cb11095c..db15c8b2f 100644 --- a/app/soapbox/service_worker/entry.js +++ b/app/soapbox/service_worker/entry.js @@ -65,7 +65,9 @@ self.addEventListener('fetch', function(event) { url.pathname.startsWith('/avatars') || url.pathname.startsWith('/authorize_follow') || url.pathname.startsWith('/media_proxy') || - url.pathname.startsWith('/relationships')) { + url.pathname.startsWith('/relationships') || + url.pathname.startsWith('/main/ostatus') || + url.pathname.startsWith('/ostatus_subscribe')) { //non-webapp routes } else if (url.pathname.startsWith('/')) { // : TODO : if is /web From d0600aef02bd05c58a242a08f60e8cf62cb31d89 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 27 Jan 2021 19:38:05 -0600 Subject: [PATCH 5/5] Refactor Follow button and remote follow --- .../features/ui/components/action_button.js | 32 ++++++++++++++----- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/app/soapbox/features/ui/components/action_button.js b/app/soapbox/features/ui/components/action_button.js index 830ce33a8..47dfb30b1 100644 --- a/app/soapbox/features/ui/components/action_button.js +++ b/app/soapbox/features/ui/components/action_button.js @@ -82,26 +82,42 @@ class ActionButton extends ImmutablePureComponent { render() { const { account, intl, me, small } = this.props; - let actionBtn = null; + const empty = <>; if (!me) { - actionBtn =