projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'release/2.0.3' into 'stable'
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
mrf
/
anti_followbot_policy.ex
diff --git
a/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex
b/lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex
index ad2d9bf5411b83cc1c5886afc63175134ee958eb..b3547ecd4530de87ecf7d04d4abc72dc5ba0f862 100644
(file)
--- a/
lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex
+++ b/
lib/pleroma/web/activity_pub/mrf/anti_followbot_policy.ex
@@
-25,11
+25,15
@@
defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy do
defp score_displayname(_), do: 0.0
defp determine_if_followbot(%User{nickname: nickname, name: displayname}) do
defp score_displayname(_), do: 0.0
defp determine_if_followbot(%User{nickname: nickname, name: displayname}) do
- # nickname will
always be a binary string because it's generated by Pleroma.
+ # nickname will
be a binary string except when following a relay
nick_score =
nick_score =
- nickname
- |> String.downcase()
- |> score_nickname()
+ if is_binary(nickname) do
+ nickname
+ |> String.downcase()
+ |> score_nickname()
+ else
+ 0.0
+ end
# displayname will either be a binary string or nil, if a displayname isn't set.
name_score =
# displayname will either be a binary string or nil, if a displayname isn't set.
name_score =
@@
-64,5
+68,5
@@
defmodule Pleroma.Web.ActivityPub.MRF.AntiFollowbotPolicy do
def filter(message), do: {:ok, message}
@impl true
def filter(message), do: {:ok, message}
@impl true
- def describe
()
, do: {:ok, %{}}
+ def describe, do: {:ok, %{}}
end
end