diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-06-18 17:20:39 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-06-18 17:20:39 +0200 |
commit | d00571ff75567aa43618f660205faeac6e9485fb (patch) | |
tree | 7d814f59842efaaf115dbd9ec68577df8aa0e8b7 /lib | |
parent | fafb765c4808f111a98a307a148f635eb42af891 (diff) | |
download | pleroma-d00571ff75567aa43618f660205faeac6e9485fb.tar.gz |
Fetch user feed on externalprofile request.
This is so we always have something to show.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 07ac30cb2..8e36ba3f4 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -9,6 +9,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do import Ecto.Query import Pleroma.Web.TwitterAPI.Utils + @httpoison Application.get_env(:pleroma, :httpoison) + def to_for_user_and_mentions(user, mentions, inReplyTo) do default_to = [ User.ap_followers(user), @@ -298,6 +300,10 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do def get_external_profile(for_user, uri) do with {:ok, %User{} = user} <- OStatus.find_or_make_user(uri) do + with url <- user.info["topic"], + {:ok, %{body: body}} <- @httpoison.get(url, [], follow_redirect: true, timeout: 10000, recv_timeout: 20000) do + OStatus.handle_incoming(body) + end {:ok, UserRepresenter.to_map(user, %{for: for_user})} else _e -> {:error, "Couldn't find user"} |