mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: missing actor on some local activities when federating out
This commit is contained in:
@@ -168,6 +168,7 @@ activitypubApi.create.privateNote = enabledCheck(async (caller, { messageObj })
|
||||
const payload = {
|
||||
id: `${object.id}#activity/create/${Date.now()}`,
|
||||
type: 'Create',
|
||||
actor: object.attributedTo,
|
||||
to: object.to,
|
||||
object,
|
||||
};
|
||||
@@ -186,6 +187,7 @@ activitypubApi.update.profile = enabledCheck(async (caller, { uid }) => {
|
||||
await activitypub.send('uid', caller.uid, targets, {
|
||||
id: `${object.id}#activity/update/${Date.now()}`,
|
||||
type: 'Update',
|
||||
actor: object.id,
|
||||
to: [activitypub._constants.publicAddress],
|
||||
cc: [],
|
||||
object,
|
||||
@@ -201,6 +203,7 @@ activitypubApi.update.category = enabledCheck(async (caller, { cid }) => {
|
||||
await activitypub.send('cid', cid, targets, {
|
||||
id: `${object.id}#activity/update/${Date.now()}`,
|
||||
type: 'Update',
|
||||
actor: object.id,
|
||||
to: [activitypub._constants.publicAddress],
|
||||
cc: [],
|
||||
object,
|
||||
@@ -227,6 +230,7 @@ activitypubApi.update.note = enabledCheck(async (caller, { post }) => {
|
||||
const payload = {
|
||||
id: `${object.id}#activity/update/${post.edited || Date.now()}`,
|
||||
type: 'Update',
|
||||
actor: object.attributedTo,
|
||||
to,
|
||||
cc,
|
||||
object,
|
||||
@@ -251,6 +255,7 @@ activitypubApi.update.privateNote = enabledCheck(async (caller, { messageObj })
|
||||
const payload = {
|
||||
id: `${object.id}#activity/create/${Date.now()}`,
|
||||
type: 'Update',
|
||||
actor: object.attributedTo,
|
||||
to,
|
||||
object,
|
||||
};
|
||||
@@ -280,6 +285,7 @@ activitypubApi.delete.note = enabledCheck(async (caller, { pid }) => {
|
||||
const payload = {
|
||||
id: `${id}#activity/delete/${Date.now()}`,
|
||||
type: 'Delete',
|
||||
actor: object.attributedTo,
|
||||
to,
|
||||
cc,
|
||||
object: id,
|
||||
@@ -334,6 +340,7 @@ activitypubApi.announce.note = enabledCheck(async (caller, { tid }) => {
|
||||
await activitypub.send('uid', caller.uid, Array.from(targets), {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/${Date.now()}`,
|
||||
type: 'Announce',
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
to,
|
||||
cc,
|
||||
object: pid,
|
||||
@@ -380,6 +387,7 @@ activitypubApi.flag = enabledCheck(async (caller, flag) => {
|
||||
await activitypub.send('uid', caller.uid, reportedIds, {
|
||||
id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/flag/${caller.uid}`,
|
||||
type: 'Flag',
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
object: reportedIds,
|
||||
content: reason,
|
||||
});
|
||||
@@ -426,6 +434,7 @@ activitypubApi.undo.flag = enabledCheck(async (caller, flag) => {
|
||||
await activitypub.send('uid', caller.uid, reportedIds, {
|
||||
id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/undo:flag/${caller.uid}/${Date.now()}`,
|
||||
type: 'Undo',
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
object: {
|
||||
id: `${nconf.get('url')}/${flag.type}/${encodeURIComponent(flag.targetId)}#activity/flag/${caller.uid}`,
|
||||
actor: `${nconf.get('url')}/uid/${caller.uid}`,
|
||||
|
||||
Reference in New Issue
Block a user