mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-08 15:05:46 +01:00
feat: fix activitypub toggler to be more complete; tests. #13054
This commit is contained in:
@@ -263,6 +263,10 @@ ActivityPub.verify = async (req) => {
|
||||
};
|
||||
|
||||
ActivityPub.get = async (type, id, uri, options) => {
|
||||
if (!meta.config.activitypubEnabled) {
|
||||
throw new Error('[[error:activitypub.not-enabled]]');
|
||||
}
|
||||
|
||||
options = {
|
||||
cache: true,
|
||||
...options,
|
||||
@@ -358,6 +362,10 @@ async function sendMessage(uri, id, type, payload, attempts = 1) {
|
||||
}
|
||||
|
||||
ActivityPub.send = async (type, id, targets, payload) => {
|
||||
if (!meta.config.activitypubEnabled) {
|
||||
return ActivityPub.helpers.log('[activitypub/send] Federation not enabled; not sending.');
|
||||
}
|
||||
|
||||
if (!Array.isArray(targets)) {
|
||||
targets = [targets];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user