diff options
author | kaniini <nenolod@gmail.com> | 2019-03-22 00:25:35 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-03-22 00:25:35 +0000 |
commit | b548181b52c4397d5034cfd95b2ef7e05c9c9c22 (patch) | |
tree | a847bb70d52da43b2f0cca45f7ea49cb4e664c5a /lib/pleroma/web/twitter_api/twitter_api.ex | |
parent | bf8b29e080a6a8a369abb53a26229bb0544de1c0 (diff) | |
parent | a223e65f35da158ef79f05f65316920dcecaa54b (diff) | |
download | pleroma-b548181b52c4397d5034cfd95b2ef7e05c9c9c22.tar.gz |
Merge branch 'feature/mastoapi-ext-conversation-id' into 'develop'
Mastodon API: add conversation_id extension
See merge request pleroma/pleroma!961
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api.ex | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index d57100491..9978c7f64 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -5,7 +5,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do alias Pleroma.Activity alias Pleroma.Mailer - alias Pleroma.Object alias Pleroma.Repo alias Pleroma.User alias Pleroma.UserEmail @@ -282,35 +281,6 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do _activities = Repo.all(q) end - # DEPRECATED mostly, context objects are now created at insertion time. - def context_to_conversation_id(context) do - with %Object{id: id} <- Object.get_cached_by_ap_id(context) do - id - else - _e -> - changeset = Object.context_mapping(context) - - case Repo.insert(changeset) do - {:ok, %{id: id}} -> - id - - # This should be solved by an upsert, but it seems ecto - # has problems accessing the constraint inside the jsonb. - {:error, _} -> - Object.get_cached_by_ap_id(context).id - end - end - end - - def conversation_id_to_context(id) do - with %Object{data: %{"id" => context}} <- Repo.get(Object, id) do - context - else - _e -> - {:error, "No such conversation"} - end - end - def get_external_profile(for_user, uri) do with %User{} = user <- User.get_or_fetch(uri) do {:ok, UserView.render("show.json", %{user: user, for: for_user})} |