Return total from pagination + tests
[akkoma] / lib / pleroma / web / activity_pub / publisher.ex
index 987a253772cebaf54423378d77499bf27c429b58..c97405690b4cb54bf829fe1a2f05c7f0d6c6507d 100644 (file)
@@ -46,15 +46,11 @@ defmodule Pleroma.Web.ActivityPub.Publisher do
   """
   def publish_one(%{inbox: inbox, json: json, actor: %User{} = actor, id: id} = params) do
     Logger.info("Federating #{id} to #{inbox}")
-    uri = URI.parse(inbox)
-    host = uri.host
-    path = uri.path
+    %{host: host, path: path} = URI.parse(inbox)
 
     digest = "SHA-256=" <> (:crypto.hash(:sha256, json) |> Base.encode64())
 
-    date =
-      NaiveDateTime.utc_now()
-      |> Timex.format!("{WDshort}, {0D} {Mshort} {YYYY} {h24}:{m}:{s} GMT")
+    date = Pleroma.Signature.signed_date()
 
     signature =
       Pleroma.Signature.sign(actor, %{