MCPcopy Create free account
hub / github.com/cloudflare/wildebeest / createDirectNote

Function createDirectNote

backend/src/activitypub/objects/note.ts:55–84  ·  view source on GitHub ↗
(
	domain: string,
	db: Database,
	content: string,
	actor: Actor,
	targetActors: Array<Actor>,
	attachment: Array<objects.APObject> = [],
	extraProperties: any = {}
)

Source from the content-addressed store, hash-verified

53}
54
55export async function createDirectNote(
56 domain: string,
57 db: Database,
58 content: string,
59 actor: Actor,
60 targetActors: Array<Actor>,
61 attachment: Array<objects.APObject> = [],
62 extraProperties: any = {}
63): Promise<Note> {
64 const actorId = new URL(actor.id)
65
66 const properties = {
67 attributedTo: actorId,
68 content,
69 to: targetActors.map((a) => a.id.toString()),
70 cc: [],
71
72 // FIXME: stub values
73 inReplyTo: null,
74 replies: null,
75 sensitive: false,
76 summary: null,
77 tag: [],
78 attachment,
79
80 ...extraProperties,
81 }
82
83 return (await objects.createObject(domain, db, NOTE, properties, actorId, true)) as Note
84}

Callers 3

timelines.spec.tsFile · 0.90
handleRequestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected