projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Do not need a function to provide fallback value with default defined in config.exs
[akkoma]
/
lib
/
pleroma
/
following_relationship.ex
diff --git
a/lib/pleroma/following_relationship.ex
b/lib/pleroma/following_relationship.ex
index 0343a20d44b5cf1b6a939cf5eff76c79e4418674..093b1f4050d62a94f70c865bc27262f2cb70b6ca 100644
(file)
--- a/
lib/pleroma/following_relationship.ex
+++ b/
lib/pleroma/following_relationship.ex
@@
-62,13
+62,10
@@
defmodule Pleroma.FollowingRelationship do
follow(follower, following, state)
following_relationship ->
follow(follower, following, state)
following_relationship ->
- {:ok, relationship} =
- following_relationship
- |> cast(%{state: state}, [:state])
- |> validate_required([:state])
- |> Repo.update()
-
- {:ok, relationship}
+ following_relationship
+ |> cast(%{state: state}, [:state])
+ |> validate_required([:state])
+ |> Repo.update()
end
end
end
end
@@
-144,6
+141,12
@@
defmodule Pleroma.FollowingRelationship do
|> where([r], r.state == ^:follow_accept)
end
|> where([r], r.state == ^:follow_accept)
end
+ def outgoing_pending_follow_requests_query(%User{} = follower) do
+ __MODULE__
+ |> where([r], r.follower_id == ^follower.id)
+ |> where([r], r.state == ^:follow_pending)
+ end
+
def following(%User{} = user) do
following =
following_query(user)
def following(%User{} = user) do
following =
following_query(user)