enabled always sending mentions (#16227)

refs TryGhost/Team#2507
-removed labs check from sending service
-labs flag controls seeing mentions in admin and receiving mentions
This commit is contained in:
Steve Larson 2023-02-03 14:52:20 -06:00 committed by GitHub
parent 02953490a5
commit 5ccb778ac8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 17 deletions

View File

@ -218,7 +218,7 @@
<div>
<h4 class="gh-expandable-title">Webmentions</h4>
<p class="gh-expandable-description">
Allow receiving webmentions from external sites and sending webmentions when linking external sites in posts.
Allows receiving webmentions from external sites and viewing them on the dashboard.
</p>
</div>
<div class="for-switch">

View File

@ -13,7 +13,6 @@ const events = require('../../lib/common/events');
const externalRequest = require('../../../server/lib/request-external.js');
const urlUtils = require('../../../shared/url-utils');
const outputSerializerUrlUtil = require('../../../server/api/endpoints/utils/serializers/output/utils/url');
const labs = require('../../../shared/labs');
const urlService = require('../url');
const settingsCache = require('../../../shared/settings-cache');
const DomainEvents = require('@tryghost/domain-events');
@ -89,7 +88,7 @@ module.exports = {
externalRequest,
getSiteUrl: () => urlUtils.urlFor('home', true),
getPostUrl: post => getPostUrl(post),
isEnabled: () => labs.isSet('webmentions') && !settingsCache.get('is_private')
isEnabled: () => !settingsCache.get('is_private')
});
sendingService.listen(events);
}

View File

@ -31,8 +31,6 @@ describe('Mentions Service', function () {
});
beforeEach(async function () {
await mockManager.mockLabsEnabled('webmentions');
// externalRequest does dns lookup; stub to make sure we don't fail with fake domain names
sinon.stub(dnsPromises, 'lookup').callsFake(function () {
return Promise.resolve({address: '123.123.123.123'});
@ -72,18 +70,6 @@ describe('Mentions Service', function () {
assert.equal(endpointMock.isDone(), false);
});
it('Respects the disabled flag', async function () {
await mockManager.mockLabsDisabled('webmentions');
let publishedPost = {status: 'published', ...mentionsPost};
await agent
.post('posts/')
.body({posts: [publishedPost]})
.expectStatus(201);
assert.equal(mentionMock.isDone(), false);
assert.equal(endpointMock.isDone(), false);
});
it('Email only post published', async function () {
let publishedPost = {status: 'published', email_only: true, ...mentionsPost};
await agent