(
domain: string,
db: Database,
content: string,
actor: Actor,
attachments: Array<objects.APObject> = [],
extraProperties: any = {}
)
| 23 | } |
| 24 | |
| 25 | export async function createPublicNote( |
| 26 | domain: string, |
| 27 | db: Database, |
| 28 | content: string, |
| 29 | actor: Actor, |
| 30 | attachments: Array<objects.APObject> = [], |
| 31 | extraProperties: any = {} |
| 32 | ): Promise<Note> { |
| 33 | const actorId = new URL(actor.id) |
| 34 | |
| 35 | const properties = { |
| 36 | attributedTo: actorId, |
| 37 | content, |
| 38 | to: [PUBLIC_GROUP], |
| 39 | cc: [actor.followers.toString()], |
| 40 | |
| 41 | // FIXME: stub values |
| 42 | replies: null, |
| 43 | sensitive: false, |
| 44 | summary: null, |
| 45 | tag: [], |
| 46 | |
| 47 | attachment: attachments, |
| 48 | inReplyTo: null, |
| 49 | ...extraProperties, |
| 50 | } |
| 51 | |
| 52 | return (await objects.createObject(domain, db, NOTE, properties, actorId, true)) as Note |
| 53 | } |
| 54 | |
| 55 | export async function createDirectNote( |
| 56 | domain: string, |
no outgoing calls
no test coverage detected