doc
)
+ if ap_id == nil do
+ ap_id =
+ XML.string_from_xpath(
+ ~s{//Link[@rel="self" and @type="application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\""]/@href},
+ doc
+ )
+ end
+
data = %{
"magic_key" => magic_key,
"topic" => topic,
{"application/activity+json", "self"} ->
Map.put(data, "ap_id", link["href"])
+ {"application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"", "self"} ->
+ Map.put(data, "ap_id", link["href"])
+
{_, "magic-public-key"} ->
"data:application/magic-public-key," <> magic_key = link["href"]
Map.put(data, "magic_key", magic_key)