diff options
author | Roger Braun <roger@rogerbraun.net> | 2018-02-11 09:50:55 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2018-02-11 09:50:55 +0100 |
commit | 52200998c997576c9008cbe50b0a7b9f0e6134cc (patch) | |
tree | c0d68f476442b8dd86fca1e182d5c09553800810 /lib/pleroma/web/ostatus | |
parent | 4a13b8488787773d09f67d1a436d5906e2f5b171 (diff) | |
parent | 0e2ca77eec511857508208d3faeb9217c4496f8a (diff) | |
download | pleroma-52200998c997576c9008cbe50b0a7b9f0e6134cc.tar.gz |
Merge branch 'develop' into feature/activitypub
Diffstat (limited to 'lib/pleroma/web/ostatus')
-rw-r--r-- | lib/pleroma/web/ostatus/feed_representer.ex | 3 | ||||
-rw-r--r-- | lib/pleroma/web/ostatus/ostatus.ex | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/lib/pleroma/web/ostatus/feed_representer.ex b/lib/pleroma/web/ostatus/feed_representer.ex index 08710f246..10860ce04 100644 --- a/lib/pleroma/web/ostatus/feed_representer.ex +++ b/lib/pleroma/web/ostatus/feed_representer.ex @@ -1,6 +1,8 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do alias Pleroma.Web.OStatus alias Pleroma.Web.OStatus.{UserRepresenter, ActivityRepresenter} + alias Pleroma.User + alias Pleroma.Web.MediaProxy def to_simple_form(user, activities, _users) do most_recent_update = (List.first(activities) || user).updated_at @@ -25,6 +27,7 @@ defmodule Pleroma.Web.OStatus.FeedRepresenter do {:id, h.(OStatus.feed_path(user))}, {:title, ['#{user.nickname}\'s timeline']}, {: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: 'salmon', href: h.(OStatus.salmon_path(user))], []}, {:link, [rel: 'self', href: h.(OStatus.feed_path(user)), type: 'application/atom+xml'], []}, diff --git a/lib/pleroma/web/ostatus/ostatus.ex b/lib/pleroma/web/ostatus/ostatus.ex index 745539b3e..c35ba42be 100644 --- a/lib/pleroma/web/ostatus/ostatus.ex +++ b/lib/pleroma/web/ostatus/ostatus.ex @@ -22,6 +22,10 @@ defmodule Pleroma.Web.OStatus do "#{user.ap_id}/salmon" end + def remote_follow_path do + "#{Web.base_url}/ostatus_subscribe?acct={uri}" + end + def handle_incoming(xml_string) do with doc when doc != :error <- parse_document(xml_string) do entries = :xmerl_xpath.string('//entry', doc) @@ -159,8 +163,7 @@ defmodule Pleroma.Web.OStatus do Get the cw that mastodon uses. """ def get_cw(entry) do - with scope when not is_nil(scope) <- string_from_xpath("//mastodon:scope", entry), - cw when not is_nil(cw) <- string_from_xpath("/*/summary", entry) do + with cw when not is_nil(cw) <- string_from_xpath("/*/summary", entry) do cw else _e -> nil end |