aboutsummaryrefslogtreecommitdiff
path: root/views/activity.go
blob: 33b73cb4b59166d15dd9984a733f2b1e0845ac53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package views

import (
	"git.capotej.com/capotej/communique/models"
	"github.com/go-fed/activity/streams"
)

func RenderActivity(name, domain string, v models.OutboxItem) (map[string]interface{}, error) {
	note, err := activityObjectNote(name, domain, v)
	if err != nil {
		return nil, err
	}
	crea, err := activityObjectCreate(name, domain, v, note)
	if err != nil {
		return nil, err
	}
	return streams.Serialize(crea)
}