From 3e4ce4b7f03c2a0bfbb890259b7bf6d714f56b04 Mon Sep 17 00:00:00 2001 From: Your New SJW Waifu Date: Wed, 14 Oct 2020 09:45:05 -0500 Subject: [PATCH] Make more anonymous --- .../web/activity_pub/mrf/sup_slash_b.ex | 49 ++++++++++++++++++- .../web/activity_pub/mrf/sup_slash_g.ex | 49 ++++++++++++++++++- .../web/activity_pub/mrf/sup_slash_mlp.ex | 49 ++++++++++++++++++- .../web/activity_pub/mrf/sup_slash_pol.ex | 49 ++++++++++++++++++- .../web/activity_pub/mrf/sup_slash_x.ex | 49 ++++++++++++++++++- 5 files changed, 235 insertions(+), 10 deletions(-) diff --git a/lib/pleroma/web/activity_pub/mrf/sup_slash_b.ex b/lib/pleroma/web/activity_pub/mrf/sup_slash_b.ex index 1cbc9e189..539002adf 100644 --- a/lib/pleroma/web/activity_pub/mrf/sup_slash_b.ex +++ b/lib/pleroma/web/activity_pub/mrf/sup_slash_b.ex @@ -7,27 +7,72 @@ defmodule Pleroma.Web.ActivityPub.MRF.SupSlashB do %{ "type" => "Create", "actor" => actor, + "to" => mto, + "cc" => mcc, "object" => %{ "type" => "Note", - "summary" => "/b/" + "summary" => "/b/", + "to" => oto, + "cc" => occ } = object } = message ) do + # Whoever is running @bonzileaks@shitposter.club decided that + # they'd "unmask" all the people having fun. You took a + # semi-anonymous fun thing and turned it into an administrative + # headache. + # The downside is that you will no longer see the posts that + # are made by people you are following, in addition to the + # downsides this creates for me, plus this is terrible code + # because I do not care about Elixir. actor_info = URI.parse(actor) if(actor_info.host == "neckbeard.xyz") do - # Logger.warn("sup /b/ #{inspect(object)}") + Logger.warn("sup /b/ #{inspect(message)}") + # There's probably a better way to do this in Elixir, but... + # "When in doubt, use brute force." -- Ken Thompson + + afol = "#{actor}/followers" object = object |> Map.put("actor", "https://neckbeard.xyz/users/b") + |> Map.put( + "to", + Enum.map(oto, fn + i when i == afol -> "https://neckbeard.xyz/users/b/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(occ, fn + i when i == afol -> "https://neckbeard.xyz/users/b/followers" + i -> i + end) + ) message = message |> Map.put("actor", "https://neckbeard.xyz/users/b") + |> Map.put( + "to", + Enum.map(mto, fn + i when i == afol -> "https://neckbeard.xyz/users/b/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(mcc, fn + i when i == afol -> "https://neckbeard.xyz/users/b/followers" + i -> i + end) + ) |> Map.put("object", object) + Logger.warn("sup /b/ NEW MESSAGE: #{inspect(message)}") {:ok, message} else {:ok, message} diff --git a/lib/pleroma/web/activity_pub/mrf/sup_slash_g.ex b/lib/pleroma/web/activity_pub/mrf/sup_slash_g.ex index ec1a3dc26..3c524e499 100644 --- a/lib/pleroma/web/activity_pub/mrf/sup_slash_g.ex +++ b/lib/pleroma/web/activity_pub/mrf/sup_slash_g.ex @@ -7,27 +7,72 @@ defmodule Pleroma.Web.ActivityPub.MRF.SupSlashG do %{ "type" => "Create", "actor" => actor, + "to" => mto, + "cc" => mcc, "object" => %{ "type" => "Note", - "summary" => "/g/" + "summary" => "/g/", + "to" => oto, + "cc" => occ } = object } = message ) do + # Whoever is running @bonzileaks@shitposter.club decided that + # they'd "unmask" all the people having fun. You took a + # semi-anonymous fun thing and turned it into an administrative + # headache. + # The downside is that you will no longer see the posts that + # are made by people you are following, in addition to the + # downsides this creates for me, plus this is terrible code + # because I do not care about Elixir. actor_info = URI.parse(actor) if(actor_info.host == "neckbeard.xyz") do - # Logger.warn("sup /g/ #{inspect(object)}") + Logger.warn("sup /g/ #{inspect(message)}") + # There's probably a better way to do this in Elixir, but... + # "When in doubt, use brute force." -- Ken Thompson + + afol = "#{actor}/followers" object = object |> Map.put("actor", "https://neckbeard.xyz/users/g") + |> Map.put( + "to", + Enum.map(oto, fn + i when i == afol -> "https://neckbeard.xyz/users/g/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(occ, fn + i when i == afol -> "https://neckbeard.xyz/users/g/followers" + i -> i + end) + ) message = message |> Map.put("actor", "https://neckbeard.xyz/users/g") + |> Map.put( + "to", + Enum.map(mto, fn + i when i == afol -> "https://neckbeard.xyz/users/g/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(mcc, fn + i when i == afol -> "https://neckbeard.xyz/users/g/followers" + i -> i + end) + ) |> Map.put("object", object) + Logger.warn("sup /g/ NEW MESSAGE: #{inspect(message)}") {:ok, message} else {:ok, message} diff --git a/lib/pleroma/web/activity_pub/mrf/sup_slash_mlp.ex b/lib/pleroma/web/activity_pub/mrf/sup_slash_mlp.ex index 9a1c3c1d4..49d5f7d9a 100644 --- a/lib/pleroma/web/activity_pub/mrf/sup_slash_mlp.ex +++ b/lib/pleroma/web/activity_pub/mrf/sup_slash_mlp.ex @@ -7,27 +7,72 @@ defmodule Pleroma.Web.ActivityPub.MRF.SupSlashMLP do %{ "type" => "Create", "actor" => actor, + "to" => mto, + "cc" => mcc, "object" => %{ "type" => "Note", - "summary" => "/mlp/" + "summary" => "/mlp/", + "to" => oto, + "cc" => occ } = object } = message ) do + # Whoever is running @bonzileaks@shitposter.club decided that + # they'd "unmask" all the people having fun. You took a + # semi-anonymous fun thing and turned it into an administrative + # headache. + # The downside is that you will no longer see the posts that + # are made by people you are following, in addition to the + # downsides this creates for me, plus this is terrible code + # because I do not care about Elixir. actor_info = URI.parse(actor) if(actor_info.host == "neckbeard.xyz") do - # Logger.warn("sup /mlp/ #{inspect(object)}") + Logger.warn("sup /mlp/ #{inspect(message)}") + # There's probably a better way to do this in Elixir, but... + # "When in doubt, use brute force." -- Ken Thompson + + afol = "#{actor}/followers" object = object |> Map.put("actor", "https://neckbeard.xyz/users/mlp") + |> Map.put( + "to", + Enum.map(oto, fn + i when i == afol -> "https://neckbeard.xyz/users/mlp/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(occ, fn + i when i == afol -> "https://neckbeard.xyz/users/mlp/followers" + i -> i + end) + ) message = message |> Map.put("actor", "https://neckbeard.xyz/users/mlp") + |> Map.put( + "to", + Enum.map(mto, fn + i when i == afol -> "https://neckbeard.xyz/users/mlp/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(mcc, fn + i when i == afol -> "https://neckbeard.xyz/users/mlp/followers" + i -> i + end) + ) |> Map.put("object", object) + Logger.warn("sup /mlp/ NEW MESSAGE: #{inspect(message)}") {:ok, message} else {:ok, message} diff --git a/lib/pleroma/web/activity_pub/mrf/sup_slash_pol.ex b/lib/pleroma/web/activity_pub/mrf/sup_slash_pol.ex index 62ac87447..9d145a543 100644 --- a/lib/pleroma/web/activity_pub/mrf/sup_slash_pol.ex +++ b/lib/pleroma/web/activity_pub/mrf/sup_slash_pol.ex @@ -7,27 +7,72 @@ defmodule Pleroma.Web.ActivityPub.MRF.SupSlashPOL do %{ "type" => "Create", "actor" => actor, + "to" => mto, + "cc" => mcc, "object" => %{ "type" => "Note", - "summary" => "/pol/" + "summary" => "/pol/", + "to" => oto, + "cc" => occ } = object } = message ) do + # Whoever is running @bonzileaks@shitposter.club decided that + # they'd "unmask" all the people having fun. You took a + # semi-anonymous fun thing and turned it into an administrative + # headache. + # The downside is that you will no longer see the posts that + # are made by people you are following, in addition to the + # downsides this creates for me, plus this is terrible code + # because I do not care about Elixir. actor_info = URI.parse(actor) if(actor_info.host == "neckbeard.xyz") do - # Logger.warn("sup /pol/ #{inspect(object)}") + Logger.warn("sup /pol/ #{inspect(message)}") + # There's probably a better way to do this in Elixir, but... + # "When in doubt, use brute force." -- Ken Thompson + + afol = "#{actor}/followers" object = object |> Map.put("actor", "https://neckbeard.xyz/users/pol") + |> Map.put( + "to", + Enum.map(oto, fn + i when i == afol -> "https://neckbeard.xyz/users/pol/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(occ, fn + i when i == afol -> "https://neckbeard.xyz/users/pol/followers" + i -> i + end) + ) message = message |> Map.put("actor", "https://neckbeard.xyz/users/pol") + |> Map.put( + "to", + Enum.map(mto, fn + i when i == afol -> "https://neckbeard.xyz/users/pol/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(mcc, fn + i when i == afol -> "https://neckbeard.xyz/users/pol/followers" + i -> i + end) + ) |> Map.put("object", object) + Logger.warn("sup /pol/ NEW MESSAGE: #{inspect(message)}") {:ok, message} else {:ok, message} diff --git a/lib/pleroma/web/activity_pub/mrf/sup_slash_x.ex b/lib/pleroma/web/activity_pub/mrf/sup_slash_x.ex index 7681bc15e..8d4373ac1 100644 --- a/lib/pleroma/web/activity_pub/mrf/sup_slash_x.ex +++ b/lib/pleroma/web/activity_pub/mrf/sup_slash_x.ex @@ -7,27 +7,72 @@ defmodule Pleroma.Web.ActivityPub.MRF.SupSlashX do %{ "type" => "Create", "actor" => actor, + "to" => mto, + "cc" => mcc, "object" => %{ "type" => "Note", - "summary" => "/x/" + "summary" => "/x/", + "to" => oto, + "cc" => occ } = object } = message ) do + # Whoever is running @bonzileaks@shitposter.club decided that + # they'd "unmask" all the people having fun. You took a + # semi-anonymous fun thing and turned it into an administrative + # headache. + # The downside is that you will no longer see the posts that + # are made by people you are following, in addition to the + # downsides this creates for me, plus this is terrible code + # because I do not care about Elixir. actor_info = URI.parse(actor) if(actor_info.host == "neckbeard.xyz") do - # Logger.warn("sup /x/ #{inspect(object)}") + Logger.warn("sup /x/ #{inspect(message)}") + # There's probably a better way to do this in Elixir, but... + # "When in doubt, use brute force." -- Ken Thompson + + afol = "#{actor}/followers" object = object |> Map.put("actor", "https://neckbeard.xyz/users/x") + |> Map.put( + "to", + Enum.map(oto, fn + i when i == afol -> "https://neckbeard.xyz/users/x/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(occ, fn + i when i == afol -> "https://neckbeard.xyz/users/x/followers" + i -> i + end) + ) message = message |> Map.put("actor", "https://neckbeard.xyz/users/x") + |> Map.put( + "to", + Enum.map(mto, fn + i when i == afol -> "https://neckbeard.xyz/users/x/followers" + i -> i + end) + ) + |> Map.put( + "cc", + Enum.map(mcc, fn + i when i == afol -> "https://neckbeard.xyz/users/x/followers" + i -> i + end) + ) |> Map.put("object", object) + Logger.warn("sup /x/ NEW MESSAGE: #{inspect(message)}") {:ok, message} else {:ok, message}