mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
fix: update 1b12 rebroadcast logic to send as application actor if post is in remote cid
This commit is contained in:
@@ -21,12 +21,17 @@ Feps.announce = async function announce(id, activity) {
|
|||||||
* - local tids (posted to remote cids) only
|
* - local tids (posted to remote cids) only
|
||||||
*/
|
*/
|
||||||
const tid = await posts.getPostField(localId || id, 'tid');
|
const tid = await posts.getPostField(localId || id, 'tid');
|
||||||
const cid = await topics.getTopicField(tid, 'cid');
|
let cid = await topics.getTopicField(tid, 'cid');
|
||||||
const shouldAnnounce = (utils.isNumber(cid) && cid > 0) || utils.isNumber(tid);
|
const localCid = utils.isNumber(cid) && cid > 0;
|
||||||
|
const shouldAnnounce = localCid || utils.isNumber(tid);
|
||||||
if (!shouldAnnounce) { // inverse conditionals can kiss my ass.
|
if (!shouldAnnounce) { // inverse conditionals can kiss my ass.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!localCid) {
|
||||||
|
cid = 0; // override cid to 0 so application actor sends the announce
|
||||||
|
}
|
||||||
|
|
||||||
let relays = await activitypub.relays.list();
|
let relays = await activitypub.relays.list();
|
||||||
relays = relays.reduce((memo, { state, url }) => {
|
relays = relays.reduce((memo, { state, url }) => {
|
||||||
if (state === 2) {
|
if (state === 2) {
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ Helpers.resolveActor = (type, id) => {
|
|||||||
|
|
||||||
case 'category':
|
case 'category':
|
||||||
case 'cid': {
|
case 'cid': {
|
||||||
return `${nconf.get('url')}/category/${id}`;
|
return `${nconf.get('url')}${id > 0 ? `/category/${id}` : '/actor'}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user