mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-07 04:51:26 +01:00
feat: add timestamp to most activity ids
This commit is contained in:
@@ -130,8 +130,8 @@ Helpers.resolveLocalId = async (input) => {
|
||||
|
||||
let activityData = {};
|
||||
if (hash.startsWith('#activity')) {
|
||||
const [, activity, data] = hash.split('/', 3);
|
||||
activityData = { activity, data };
|
||||
const [, activity, data, timestamp] = hash.split('/', 4);
|
||||
activityData = { activity, data, timestamp };
|
||||
}
|
||||
|
||||
// https://bb.devnull.land/cid/2#activity/follow/activitypub@community.nodebb.org│
|
||||
|
||||
@@ -48,7 +48,7 @@ inbox.create = async (req) => {
|
||||
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
||||
if (followers.length) {
|
||||
await activitypub.send('cid', cid, followers, {
|
||||
id: `${object.id}#activity/announce`,
|
||||
id: `${object.id}#activity/announce/${Date.now()}`,
|
||||
type: 'Announce',
|
||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||
cc: [activitypub._constants.publicAddress],
|
||||
@@ -281,7 +281,7 @@ inbox.follow = async (req) => {
|
||||
|
||||
user.onFollow(actor, id);
|
||||
activitypub.send('uid', id, actor, {
|
||||
id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}`,
|
||||
id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}/${Date.now()}`,
|
||||
type: 'Accept',
|
||||
object: {
|
||||
id: followId,
|
||||
@@ -308,7 +308,7 @@ inbox.follow = async (req) => {
|
||||
}
|
||||
|
||||
activitypub.send('cid', id, actor, {
|
||||
id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}`,
|
||||
id: `${nconf.get('url')}/${type}/${id}#activity/accept:follow/${handle}/${Date.now()}`,
|
||||
type: 'Accept',
|
||||
object: {
|
||||
id: followId,
|
||||
|
||||
@@ -159,7 +159,7 @@ Notes.assert = async (uid, input, options = { skipChecks: false }) => {
|
||||
const followers = await activitypub.notes.getCategoryFollowers(cid);
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await activitypub.send('cid', cid, followers, {
|
||||
id: `${object.id}#activity/announce`,
|
||||
id: `${object.id}#activity/announce/${Date.now()}`,
|
||||
type: 'Announce',
|
||||
to: [`${nconf.get('url')}/category/${cid}/followers`],
|
||||
cc: [activitypub._constants.publicAddress],
|
||||
|
||||
Reference in New Issue
Block a user