Skip to content

Commit

Permalink
Delete Activity id をランダムにしないように
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Jan 31, 2020
1 parent 9681319 commit 6613528
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 11 additions & 5 deletions src/remote/activitypub/renderer/delete.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import config from '../../../config';
import { ILocalUser } from '../../../models/user';

export default (object: any, user: ILocalUser) => ({
type: 'Delete',
actor: `${config.url}/users/${user._id}`,
object
});
export default (object: any, user: ILocalUser, id?: string) => {
const activity = {
type: 'Delete',
actor: `${config.url}/users/${user._id}`,
object
} as any;

if (id) activity.id = id;

return activity;
};
2 changes: 1 addition & 1 deletion src/services/note/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default async function(user: IUser, note: INote, quiet = false) {

const content = renderActivity(renote
? renderUndo(renderAnnounce(renote.uri || `${config.url}/notes/${renote._id}`, note), user)
: renderDelete(renderTombstone(`${config.url}/notes/${note._id}`), user));
: renderDelete(renderTombstone(`${config.url}/notes/${note._id}`), user, `${config.url}/notes/${note._id}/delete`));

deliverToFollowers(user, content);
}
Expand Down

0 comments on commit 6613528

Please sign in to comment.