diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-10 18:44:57 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-10 18:44:57 +0200 |
commit | 36448d6483c7f53266052e72bd39b04558478410 (patch) | |
tree | b3a7ddfc2520b33a93a6d3bc1cd1915219e92609 /lib/pleroma/web/twitter_api/twitter_api.ex | |
parent | 2e753e8cd740d540eae7badf5c48197d3914b5f5 (diff) | |
download | pleroma-36448d6483c7f53266052e72bd39b04558478410.tar.gz |
Add externalprofile to TwAPI.
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index d73ef3c77..d048d07c3 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -350,4 +350,12 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do {:error, "No such conversation"} end end + + def get_external_profile(for_user, uri) do + with %User{} = user <- User.get_cached_by_ap_id(uri) do + {:ok, UserRepresenter.to_map(user, %{for: for_user})} + else _e -> + {:error, "Couldn't find user"} + end + end end |