projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix function
[akkoma]
/
lib
/
pleroma
/
user.ex
diff --git
a/lib/pleroma/user.ex
b/lib/pleroma/user.ex
index 463bb9ad44162cebb66534c6213ff0a74f26d07a..a3f6add28cb13f033ecba47fc604733a75155771 100644
(file)
--- a/
lib/pleroma/user.ex
+++ b/
lib/pleroma/user.ex
@@
-873,10
+873,13
@@
defmodule Pleroma.User do
def blocks?(%User{info: info} = _user, %{ap_id: ap_id}) do
blocks = info.blocks
def blocks?(%User{info: info} = _user, %{ap_id: ap_id}) do
blocks = info.blocks
- domain_blocks = info.domain_blocks
+
+ domain_blocks = Pleroma.Web.ActivityPub.MRF.subdomains_regex(info.domain_blocks)
+
%{host: host} = URI.parse(ap_id)
%{host: host} = URI.parse(ap_id)
- Enum.member?(blocks, ap_id) || Enum.any?(domain_blocks, &(&1 == host))
+ Enum.member?(blocks, ap_id) ||
+ Pleroma.Web.ActivityPub.MRF.subdomain_match?(domain_blocks, host)
end
def subscribed_to?(user, %{ap_id: ap_id}) do
end
def subscribed_to?(user, %{ap_id: ap_id}) do
@@
-1211,7
+1214,7
@@
defmodule Pleroma.User do
data
|> Map.put(:name, blank?(data[:name]) || data[:nickname])
|> remote_user_creation()
data
|> Map.put(:name, blank?(data[:name]) || data[:nickname])
|> remote_user_creation()
- |> Repo.insert(on_conflict: :replace_all, conflict_target: :nickname)
+ |> Repo.insert(on_conflict: :replace_all
_except_primary_key
, conflict_target: :nickname)
|> set_cache()
end
|> set_cache()
end
@@
-1410,4
+1413,8
@@
defmodule Pleroma.User do
end
defp put_password_hash(changeset), do: changeset
end
defp put_password_hash(changeset), do: changeset
+
+ def is_internal_user?(%User{nickname: nil}), do: true
+ def is_internal_user?(%User{local: true, nickname: "internal." <> _}), do: true
+ def is_internal_user?(_), do: false
end
end