Merge branch 'ostatus' of ssh.gitgud.io:lambadalambda/pleroma into ostatus
[akkoma] / lib / pleroma / web / ostatus / activity_representer.ex
1 defmodule Pleroma.Web.OStatus.ActivityRepresenter do
2 def to_simple_form(activity, user) do
3 h = fn(str) -> [to_charlist(str)] end
4
5 updated_at = activity.updated_at
6 |> NaiveDateTime.to_iso8601
7 inserted_at = activity.inserted_at
8 |> NaiveDateTime.to_iso8601
9
10 [
11 {:"activity:object-type", ['http://activitystrea.ms/schema/1.0/note']},
12 {:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']},
13 {:id, h.(activity.data["id"])},
14 {:title, ['New note by #{user.nickname}']},
15 {:content, [type: 'html'], h.(activity.data["object"]["content"])},
16 {:published, h.(inserted_at)},
17 {:updated, h.(updated_at)}
18 ]
19 end
20 end