From: squidboi Date: Sat, 16 Jun 2018 22:37:16 +0000 (-0700) Subject: Merge branch 'develop' into feature/configurable-blocks X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2e294ee44a1baa7c0d3ac6b2905a70ed4e05cffb;p=akkoma Merge branch 'develop' into feature/configurable-blocks --- 2e294ee44a1baa7c0d3ac6b2905a70ed4e05cffb diff --cc config/config.exs index b8dd867c4,5e57af87b..e1a77d3e1 --- a/config/config.exs +++ b/config/config.exs @@@ -57,13 -57,12 +57,17 @@@ config :pleroma, :instance public: true, quarantined_instances: [] -config :pleroma, :activitypub, accept_blocks: true +config :pleroma, :activitypub, + accept_blocks: true, + unfollow_blocked: true, + outgoing_blocks: true + +config :pleroma, :user, deny_follow_blocked: true + config :pleroma, :mrf_rejectnonpublic, + allow_followersonly: false, + allow_direct: false + config :pleroma, :mrf_simple, media_removal: [], media_nsfw: [], diff --cc lib/pleroma/user.ex index dd645b2e5,b27397e13..1fcec479f --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@@ -201,9 -197,14 +201,17 @@@ defmodule Pleroma.User d end end + def maybe_follow(%User{} = follower, %User{info: info} = followed) do + if not following?(follower, followed) do + follow(follower, followed) + else + {:ok, follower} + end + end + + @user_config Application.get_env(:pleroma, :user) + @deny_follow_blocked Keyword.get(@user_config, :deny_follow_blocked) + def follow(%User{} = follower, %User{info: info} = followed) do ap_followers = followed.follower_address