소스 검색

Add attachments to feed.

tags/v0.9.9
Roger Braun 7 년 전
부모
커밋
ece85fc8bc
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +6
    -1
      lib/pleroma/web/ostatus/activity_representer.ex

+ 6
- 1
lib/pleroma/web/ostatus/activity_representer.ex 파일 보기

@@ -7,6 +7,11 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
inserted_at = activity.inserted_at
|> NaiveDateTime.to_iso8601

attachments = Enum.map(activity.data["object"]["attachment"] || [], fn(attachment) ->
url = hd(attachment["url"])
{:link, [rel: 'enclosure', href: to_charlist(url["href"]), type: to_charlist(url["mediaType"])], []}
end)

[
{:"activity:object-type", ['http://activitystrea.ms/schema/1.0/note']},
{:"activity:verb", ['http://activitystrea.ms/schema/1.0/post']},
@@ -15,6 +20,6 @@ defmodule Pleroma.Web.OStatus.ActivityRepresenter do
{:content, [type: 'html'], h.(activity.data["object"]["content"])},
{:published, h.(inserted_at)},
{:updated, h.(updated_at)}
]
] ++ attachments
end
end

불러오는 중...
취소
저장