forked from AkkomaGang/akkoma
Merge branch 'hakabahitoyo/pleroma-feature/atom-feed-logo' into develop
This commit is contained in:
commit
ad0ab3a57b
3 changed files with 6 additions and 2 deletions
|
@ -1,6 +1,8 @@
|
||||||
defmodule Pleroma.Web.OStatus.FeedRepresenter do
|
defmodule Pleroma.Web.OStatus.FeedRepresenter do
|
||||||
alias Pleroma.Web.OStatus
|
alias Pleroma.Web.OStatus
|
||||||
alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
|
alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter}
|
||||||
|
alias Pleroma.User
|
||||||
|
alias Pleroma.Web.MediaProxy
|
||||||
|
|
||||||
def to_simple_form(user, activities, _users) do
|
def to_simple_form(user, activities, _users) do
|
||||||
most_recent_update = (List.first(activities) || user).updated_at
|
most_recent_update = (List.first(activities) || user).updated_at
|
||||||
|
@ -25,6 +27,7 @@ def to_simple_form(user, activities, _users) do
|
||||||
{:id, h.(OStatus.feed_path(user))},
|
{:id, h.(OStatus.feed_path(user))},
|
||||||
{:title, ['#{user.nickname}\'s timeline']},
|
{:title, ['#{user.nickname}\'s timeline']},
|
||||||
{:updated, h.(most_recent_update)},
|
{:updated, h.(most_recent_update)},
|
||||||
|
{:logo, [to_charlist(User.avatar_url(user) |> MediaProxy.url())]},
|
||||||
{:link, [rel: 'hub', href: h.(OStatus.pubsub_path(user))], []},
|
{:link, [rel: 'hub', href: h.(OStatus.pubsub_path(user))], []},
|
||||||
{:link, [rel: 'salmon', href: h.(OStatus.salmon_path(user))], []},
|
{:link, [rel: 'salmon', href: h.(OStatus.salmon_path(user))], []},
|
||||||
{:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []},
|
{:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []},
|
||||||
|
|
|
@ -14,9 +14,9 @@ test "notifies someone when they are directly addressed" do
|
||||||
|
|
||||||
{:ok, [notification, other_notification]} = Notification.create_notifications(activity)
|
{:ok, [notification, other_notification]} = Notification.create_notifications(activity)
|
||||||
|
|
||||||
assert notification.user_id == other_user.id
|
notified_ids = Enum.sort([notification.user_id, other_notification.user_id])
|
||||||
|
assert notified_ids == [other_user.id, third_user.id]
|
||||||
assert notification.activity_id == activity.id
|
assert notification.activity_id == activity.id
|
||||||
assert other_notification.user_id == third_user.id
|
|
||||||
assert other_notification.activity_id == activity.id
|
assert other_notification.activity_id == activity.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,6 +26,7 @@ test "returns a feed of the last 20 items of the user" do
|
||||||
<id>#{OStatus.feed_path(user)}</id>
|
<id>#{OStatus.feed_path(user)}</id>
|
||||||
<title>#{user.nickname}'s timeline</title>
|
<title>#{user.nickname}'s timeline</title>
|
||||||
<updated>#{most_recent_update}</updated>
|
<updated>#{most_recent_update}</updated>
|
||||||
|
<logo>#{User.avatar_url(user)}</logo>
|
||||||
<link rel="hub" href="#{OStatus.pubsub_path(user)}" />
|
<link rel="hub" href="#{OStatus.pubsub_path(user)}" />
|
||||||
<link rel="salmon" href="#{OStatus.salmon_path(user)}" />
|
<link rel="salmon" href="#{OStatus.salmon_path(user)}" />
|
||||||
<link rel="self" href="#{OStatus.feed_path(user)}" type="application/atom+xml" />
|
<link rel="self" href="#{OStatus.feed_path(user)}" type="application/atom+xml" />
|
||||||
|
|
Loading…
Reference in a new issue