mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-15 21:10:22 +01:00
fix: update announce and undo(announce) so that their IDs don't use timestamps
This commit is contained in:
@@ -58,7 +58,7 @@ Feps.announce = async function announce(id, activity) {
|
||||
if (isMain) {
|
||||
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing plain object (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${localCid ? `cid/${cid}` : 'uid/0'}`,
|
||||
type: 'Announce',
|
||||
actor: localCid ? `${nconf.get('url')}/category/${cid}` : `${nconf.get('url')}/actor`,
|
||||
to,
|
||||
@@ -70,7 +70,7 @@ Feps.announce = async function announce(id, activity) {
|
||||
|
||||
activitypub.helpers.log(`[activitypub/inbox.announce(1b12)] Announcing ${activity.type} (${activity.id}) to followers of cid ${cid} and ${relays.length} relays`);
|
||||
await activitypub.send('cid', localCid ? cid : 0, targets, {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now + 1}`,
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(id)}#activity/announce/${now}`,
|
||||
type: 'Announce',
|
||||
actor: localCid ? `${nconf.get('url')}/category/${cid}` : `${nconf.get('url')}/actor`,
|
||||
to,
|
||||
|
||||
@@ -301,7 +301,7 @@ Out.announce.topic = enabledCheck(async (tid) => {
|
||||
}, { cid, uid: utils.isNumber(uid) ? uid : undefined });
|
||||
|
||||
await activitypub.send('cid', cid, Array.from(targets), {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/${Date.now()}`,
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/cid/${cid}`,
|
||||
type: 'Announce',
|
||||
actor: `${nconf.get('url')}/category/${cid}`,
|
||||
to,
|
||||
@@ -558,13 +558,13 @@ Out.undo.announce = enabledCheck(async (type, id, tid) => {
|
||||
|
||||
// Just undo the announce.
|
||||
await activitypub.send(type, id, Array.from(targets), {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/undo:announce/${Date.now()}`,
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/undo:announce/${type}/${id}`,
|
||||
type: 'Undo',
|
||||
actor: baseUrl,
|
||||
to,
|
||||
cc,
|
||||
object: {
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/${Date.now()}`, // wrong timestamp btw
|
||||
id: `${nconf.get('url')}/post/${encodeURIComponent(pid)}#activity/announce/${type}/${id}`,
|
||||
type: 'Announce',
|
||||
actor: baseUrl,
|
||||
to,
|
||||
|
||||
Reference in New Issue
Block a user