diff --git a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj index 4a4c43c..1d72648 100644 --- a/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj +++ b/src/main/clj/org/domaindrivenarchitecture/activity_pub_poc/core.clj @@ -57,7 +57,6 @@ (def like? (s/keys :req-un [context type-string - id-uri to-uri actor object])) @@ -67,8 +66,8 @@ (def activity-streams-context "https://www.w3.org/ns/activitystreams") (def like-data - {:to "https://chatty.bla/ben/" - :target "posts/234s23-2g34234-2hhj536" + {:to ["https://chatty.bla/ben/", "https://chatty.bla/gen/"] + :target "https://chatty.bla/ben/posts/234s23-2g34234-2hhj536" :from "https://social.bla/alyssa/"}) (defn generate-id-from-object [from] @@ -79,7 +78,6 @@ (assoc {} "@context" activity-streams-context "type" "Like" - "id" (generate-id-from-object (:from input-map)) "to" (:to input-map) "actor" (:from input-map) "object" (:target input-map))) @@ -89,7 +87,7 @@ filename string?] (-> input - (json/write-str) + (json/write-str :escape-slash false) (#(spit filename %)))) diff --git a/src/test/resources/like.json b/src/test/resources/like.json index 5d30525..cb91da3 100644 --- a/src/test/resources/like.json +++ b/src/test/resources/like.json @@ -1,8 +1 @@ -{ - "@context": "https:\/\/www.w3.org\/ns\/activitystreams", - "type": "Like", - "id": "https:\/\/social.bla\/alyssa\/out\/sdfsd44243g324g3455", - "to": "https:\/\/chatty.bla\/ben\/", - "actor": "https:\/\/social.bla\/alyssa\/", - "object": "posts\/234s23-2g34234-2hhj536" -} \ No newline at end of file +{"@context":"https://www.w3.org/ns/activitystreams","type":"Like","to":["https://chatty.bla/ben/","https://chatty.bla/gen/"],"actor":"https://social.bla/alyssa/","object":"https://chatty.bla/ben/posts/234s23-2g34234-2hhj536"} \ No newline at end of file