Hid Bridgy Webmentions

fixes https://github.com/TryGhost/Team/issues/2591
This commit is contained in:
Simon Backx 2023-02-22 12:20:14 +01:00
parent bf675e471f
commit aed10d38f0
3 changed files with 18 additions and 0 deletions

View File

@ -30,6 +30,9 @@ export default class MentionsRoute extends AuthenticatedRoute {
paginationSettings.filter = `resource_id:${params.post_id}+resource_type:post`;
}
// Filter bridgy mentions
// paginationSettings.filter = `${paginationSettings.filter ? (paginationSettings.filter + '+') : ''}source:-~^'https://brid.gy/'`;
return RSVP.hash({
mentions: this.infinity.model('mention', paginationSettings),
post: params.post_id ? this.store.findRecord('post', params.post_id) : null

View File

@ -51,6 +51,10 @@ module.exports = {
return require('./webhooks');
},
get mentions() {
return require('./mentions');
},
get comments() {
return require('./comments');
}

View File

@ -0,0 +1,11 @@
module.exports = {
browse(_apiConfig, frame) {
// Force source:-~^'https://brid.gy/' to be added to the filter
const filterBridgy = `source:-~^'https://brid.gy/'`;
if (frame.options.filter) {
frame.options.filter = `${frame.options.filter}+${filterBridgy}`;
} else {
frame.options.filter = filterBridgy;
}
}
};