- def auth_active?(%User{} = user) do
- (user.info && !user.info.confirmation_pending) ||
- !Pleroma.Config.get([:instance, :account_activation_required])
- end
+ def auth_active?(%User{info: %User.Info{confirmation_pending: false}}), do: true
+
+ def auth_active?(%User{info: %User.Info{confirmation_pending: true}}),
+ do: !Pleroma.Config.get([:instance, :account_activation_required])
+
+ def auth_active?(_), do: false
+
+ 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, for_user \\ nil)