aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web/twitter_api/controllers
diff options
context:
space:
mode:
authorIvan Tashkinov <ivant.business@gmail.com>2019-04-02 14:05:34 +0300
committerIvan Tashkinov <ivant.business@gmail.com>2019-04-02 14:05:34 +0300
commit37925cbe78b7fc73f28cc85ffcf1e16fb00f7a24 (patch)
tree2e3f848e697426f4b79d8e02a2ba20df12368ca9 /lib/pleroma/web/twitter_api/controllers
parent590c935d95f0ea4fb65994027a88a0623527af88 (diff)
parent091baf93169895c62418ccee81b80d00416aaa56 (diff)
downloadpleroma-37925cbe78b7fc73f28cc85ffcf1e16fb00f7a24.tar.gz
Merge remote-tracking branch 'remotes/upstream/develop' into twitter_oauth
# Conflicts: # lib/pleroma/web/oauth/oauth_controller.ex # lib/pleroma/web/router.ex
Diffstat (limited to 'lib/pleroma/web/twitter_api/controllers')
-rw-r--r--lib/pleroma/web/twitter_api/controllers/util_controller.ex8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pleroma/web/twitter_api/controllers/util_controller.ex b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
index faa733fec..e817f0d79 100644
--- a/lib/pleroma/web/twitter_api/controllers/util_controller.ex
+++ b/lib/pleroma/web/twitter_api/controllers/util_controller.ex
@@ -21,7 +21,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
def show_password_reset(conn, %{"token" => token}) do
with %{used: false} = token <- Repo.get_by(PasswordResetToken, %{token: token}),
- %User{} = user <- Repo.get(User, token.user_id) do
+ %User{} = user <- User.get_by_id(token.user_id) do
render(conn, "password_reset.html", %{
token: token,
user: user
@@ -96,13 +96,13 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
def do_remote_follow(conn, %{
"authorization" => %{"name" => username, "password" => password, "id" => id}
}) do
- followee = Repo.get(User, id)
+ followee = User.get_by_id(id)
avatar = User.avatar_url(followee)
name = followee.nickname
with %User{} = user <- User.get_cached_by_nickname(username),
true <- Pbkdf2.checkpw(password, user.password_hash),
- %User{} = _followed <- Repo.get(User, id),
+ %User{} = _followed <- User.get_by_id(id),
{:ok, follower} <- User.follow(user, followee),
{:ok, _activity} <- ActivityPub.follow(follower, followee) do
conn
@@ -124,7 +124,7 @@ defmodule Pleroma.Web.TwitterAPI.UtilController do
end
def do_remote_follow(%{assigns: %{user: user}} = conn, %{"user" => %{"id" => id}}) do
- with %User{} = followee <- Repo.get(User, id),
+ with %User{} = followee <- User.get_by_id(id),
{:ok, follower} <- User.follow(user, followee),
{:ok, _activity} <- ActivityPub.follow(follower, followee) do
conn