Additional merge changes
This commit is contained in:
parent
3cb4f5158e
commit
4841823d67
|
@ -308,49 +308,7 @@ exports.getModule = class ActivityPubWebHandler extends WebHandlerModule {
|
||||||
// :TODO: Implement the queue
|
// :TODO: Implement the queue
|
||||||
const activityPubSettings = ActivityPubSettings.fromUser(user);
|
const activityPubSettings = ActivityPubSettings.fromUser(user);
|
||||||
if (!activityPubSettings.manuallyApproveFollowers) {
|
if (!activityPubSettings.manuallyApproveFollowers) {
|
||||||
Actor.fromLocalUser(user, this.webServer, (err, localActor) => {
|
this._recordAcceptedFollowRequest(user, activity.actor, activity);
|
||||||
if (err) {
|
|
||||||
return this.log.warn(
|
|
||||||
{ user: user, error: err.message },
|
|
||||||
'Failed to load local Actor for "Accept"'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const accept = Activity.makeAccept(this.webServer, localActor, activity);
|
|
||||||
|
|
||||||
accept.sendTo(
|
|
||||||
localActor.inbox,
|
|
||||||
user,
|
|
||||||
this.webServer,
|
|
||||||
(err, respBody, res) => {
|
|
||||||
if (err) {
|
|
||||||
return this.log.warn(
|
|
||||||
{
|
|
||||||
inbox: localActor.inbox,
|
|
||||||
statusCode: res.statusCode,
|
|
||||||
error: err.message,
|
|
||||||
},
|
|
||||||
'Failed POSTing "Accept" to inbox'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res.statusCode !== 202 && res.statusCode !== 200) {
|
|
||||||
return this.log.warn(
|
|
||||||
{
|
|
||||||
inbox: localActor.inbox,
|
|
||||||
statusCode: res.statusCode,
|
|
||||||
},
|
|
||||||
'Unexpected status code'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.log.trace(
|
|
||||||
{ inbox: localActor.inbox },
|
|
||||||
'Remote server received our "Accept" successfully'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resp.writeHead(200, { 'Content-Type': 'text/html' });
|
resp.writeHead(200, { 'Content-Type': 'text/html' });
|
||||||
|
|
Loading…
Reference in New Issue