projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
List messages must be visible for mentioned users
[akkoma]
/
lib
/
pleroma
/
web
/
activity_pub
/
publisher.ex
diff --git
a/lib/pleroma/web/activity_pub/publisher.ex
b/lib/pleroma/web/activity_pub/publisher.ex
index 036ac892e0d613efa9597828d3e7f6c14c923764..18145e45f8c0c39e8b47bca8448727bb7a9fdb52 100644
(file)
--- a/
lib/pleroma/web/activity_pub/publisher.ex
+++ b/
lib/pleroma/web/activity_pub/publisher.ex
@@
-5,6
+5,7
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
alias Pleroma.Activity
alias Pleroma.Config
defmodule Pleroma.Web.ActivityPub.Publisher do
alias Pleroma.Activity
alias Pleroma.Config
+ alias Pleroma.HTTP
alias Pleroma.Instances
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Relay
alias Pleroma.Instances
alias Pleroma.User
alias Pleroma.Web.ActivityPub.Relay
@@
-16,8
+17,6
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
require Logger
require Logger
- @httpoison Application.get_env(:pleroma, :httpoison)
-
@moduledoc """
ActivityPub outgoing federation module.
"""
@moduledoc """
ActivityPub outgoing federation module.
"""
@@
-54,7
+53,7
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
|> Timex.format!("{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
signature =
|> Timex.format!("{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
signature =
- Pleroma.
Web.HTTPSignatures
.sign(actor, %{
+ Pleroma.
Signature
.sign(actor, %{
host: host,
"content-length": byte_size(json),
digest: digest,
host: host,
"content-length": byte_size(json),
digest: digest,
@@
-63,7
+62,7
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
with {:ok, %{status: code}} when code in 200..299 <-
result =
with {:ok, %{status: code}} when code in 200..299 <-
result =
-
@httpoison
.post(
+
HTTP
.post(
inbox,
json,
[
inbox,
json,
[
@@
-89,7
+88,7
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
true
else
inbox_info = URI.parse(inbox)
true
else
inbox_info = URI.parse(inbox)
- !Enum.member?(
Pleroma.
Config.get([:instance, :quarantined_instances], []), inbox_info.host)
+ !Enum.member?(Config.get([:instance, :quarantined_instances], []), inbox_info.host)
end
end
end
end
@@
-132,12
+131,13
@@
defmodule Pleroma.Web.ActivityPub.Publisher do
%User{ap_id: ap_id} =
Enum.find(recipients, fn %{info: %{source_data: data}} -> data["inbox"] == inbox end)
%User{ap_id: ap_id} =
Enum.find(recipients, fn %{info: %{source_data: data}} -> data["inbox"] == inbox end)
+ # Get all the recipients on the same host and add them to cc. Otherwise it a remote
+ # instance would only accept a first message for the first recipient and ignore the rest.
cc = get_cc_ap_ids(ap_id, recipients)
json =
data
|> Map.put("cc", cc)
cc = get_cc_ap_ids(ap_id, recipients)
json =
data
|> Map.put("cc", cc)
- |> Map.put("directMessage", true)
|> Jason.encode!()
Pleroma.Web.Federator.Publisher.enqueue_one(__MODULE__, %{
|> Jason.encode!()
Pleroma.Web.Federator.Publisher.enqueue_one(__MODULE__, %{