aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-05-18 18:18:27 +0200
committerRoger Braun <roger@rogerbraun.net>2017-05-18 18:18:27 +0200
commit8e02fa100f9f207253a35fbfd92e6e8f9b585435 (patch)
tree2d142ec92ddc6c8e4234ed561cb8e02a218e54ad /lib
parent36ec998dd71d09462f828cad093cfe68018cf9f3 (diff)
downloadpleroma-8e02fa100f9f207253a35fbfd92e6e8f9b585435.tar.gz
Add categories to ostatus output.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/ostatus/activity_representer.ex5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/web/ostatus/activity_representer.ex b/lib/pleroma/web/ostatus/activity_representer.ex
index 02d15ea94..ccf71218c 100644
--- a/lib/pleroma/web/ostatus/activity_representer.ex
+++ b/lib/pleroma/web/ostatus/activity_representer.ex
@@ -42,6 +42,9 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
author = if with_author, do: [{:author, UserRepresenter.to_simple_form(user)}], else: []
mentions = activity.data["to"] |> get_mentions
+ categories = (activity.data["object"]["tag"] || [])
+ |> Enum.map(fn (tag) -> {:category, [term: to_charlist(tag)], []} end)
+
[
{:"activity:object-type", ['http://activitystrea.ms/schema/1.0/note']},
{:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']},
@@ -53,7 +56,7 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
{:"ostatus:conversation", [], h.(activity.data["context"])},
{:link, [href: h.(activity.data["context"]), rel: 'ostatus:conversation'], []},
{:link, [type: ['application/atom+xml'], href: h.(activity.data["object"]["id"]), rel: 'self'], []}
- ] ++ attachments ++ in_reply_to ++ author ++ mentions
+ ] ++ categories ++ attachments ++ in_reply_to ++ author ++ mentions
end
def to_simple_form(%{data: %{"type" => "Like"}} = activity, user, with_author) do