MCPcopy Create free account
hub / github.com/davecheney/pub / objToStatusPoll

Function objToStatusPoll

activitypub/inbox.go:368–393  ·  view source on GitHub ↗
(obj map[string]any)

Source from the content-addressed store, hash-verified

366 if err != nil {
367 updated = published
368 }
369 return published, updated, nil
370}
371
372func inReplyToID(inReplyTo *models.Status) *snowflake.ID {
373 if inReplyTo != nil {
374 return &inReplyTo.ID
375 }
376 return nil
377}
378
379func inReplyToActorID(inReplyTo *models.Status) *snowflake.ID {
380 if inReplyTo != nil {
381 return &inReplyTo.ActorID
382 }
383 return nil
384}
385
386func objToStatusAttachment(obj map[string]any) *models.StatusAttachment {
387 return &models.StatusAttachment{
388 Attachment: models.Attachment{
389 ID: snowflake.Now(),
390 MediaType: stringFromAny(obj["mediaType"]),
391 URL: stringFromAny(obj["url"]),
392 Name: stringFromAny(obj["name"]),
393 Width: intFromAny(obj["width"]),
394 Height: intFromAny(obj["height"]),
395 Blurhash: stringFromAny(obj["blurhash"]),
396 FocalPoint: focalPoint(obj),

Callers

nothing calls this directly

Calls 5

timeFromAnyFunction · 0.85
mapFromAnyFunction · 0.85
intFromAnyFunction · 0.85
anyToSliceFunction · 0.70
stringFromAnyFunction · 0.70

Tested by

no test coverage detected