- def wrap_with_entry(simple_form) do
- [{
- :entry, [
- xmlns: 'http://www.w3.org/2005/Atom',
- "xmlns:thr": 'http://purl.org/syndication/thread/1.0',
- "xmlns:activity": 'http://activitystrea.ms/spec/1.0/',
- "xmlns:poco": 'http://portablecontacts.net/spec/1.0',
- "xmlns:ostatus": 'http://ostatus.org/schema/1.0'
- ], simple_form
- }]
+ def to_simple_form(%{data: %{"type" => "Delete"}} = activity, user, with_author) do
+ h = fn str -> [to_charlist(str)] end
+
+ updated_at = activity.data["published"]
+ inserted_at = activity.data["published"]
+
+ author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
+
+ [
+ {:"activity:object-type", ['http://activitystrea.ms/schema/1.0/activity']},
+ {:"activity:verb", ['http://activitystrea.ms/schema/1.0/delete']},
+ {:id, h.(activity.data["object"])},
+ {:title, ['An object was deleted']},
+ {:content, [type: 'html'], ['An object was deleted']},
+ {:published, h.(inserted_at)},
+ {:updated, h.(updated_at)}
+ ] ++ author