user: use pattern matching to determine if user is local or remote instead of the...
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 9 Jan 2019 04:46:03 +0000 (04:46 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 9 Jan 2019 06:02:18 +0000 (06:02 +0000)
lib/pleroma/user.ex

index 85d0f9fce297d8ba6b97c35d3cf7c93615a16b4e..ce909601d062f87ab285cb63774cd393186a13f4 100644 (file)
@@ -49,7 +49,8 @@ defmodule Pleroma.User do
       !Pleroma.Config.get([:instance, :account_activation_required])
   end
 
-  def remote_or_auth_active?(%User{} = user), do: !user.local || auth_active?(user)
+  def remote_or_auth_active?(%User{local: false}), do: true
+  def remote_or_auth_active?(%User{local: true} = user), do: auth_active?(user)
 
   def visible_for?(%User{} = user, for_user \\ nil) do
     User.remote_or_auth_active?(user) || (for_user && for_user.id == user.id) ||