- def content_with_tags(content, tags) do
- tags = tags || []
- text_content = HtmlSanitizeEx.strip_tags(content)
- found_tags = Formatter.parse_tags(text_content)
- |> Enum.map(fn ({_, tag}) -> tag end)
+ # TODO:
+ # Make this more proper. Just a placeholder to not break the frontend.
+ def to_map(
+ %Activity{
+ data: %{"type" => "Undo", "published" => created_at, "object" => undid_activity}
+ } = activity,
+ %{user: user} = opts
+ ) do
+ created_at = created_at |> Utils.date_to_asctime()
+
+ text = "#{user.nickname} undid the action at #{undid_activity["id"]}"
+
+ %{
+ "id" => activity.id,
+ "user" => UserView.render("show.json", %{user: user, for: opts[:for]}),
+ "attentions" => [],
+ "statusnet_html" => text,
+ "text" => text,
+ "is_local" => activity.local,
+ "is_post_verb" => false,
+ "created_at" => created_at,
+ "in_reply_to_status_id" => nil,
+ "external_url" => activity.data["id"],
+ "activity_type" => "undo"
+ }
+ end