Keep ostatus id as activity id.
[akkoma] / lib / pleroma / web / ostatus / ostatus_controller.ex
index ff6d7301ac977ea4cf0a6d20e8d874a92568fa20..4174db786c688c69826ad964a6dfd8a2b51d1674 100644 (file)
@@ -18,9 +18,21 @@ defmodule Pleroma.Web.OStatus.OStatusController do
 
     response = FeedRepresenter.to_simple_form(user, activities, [user])
     |> :xmerl.export_simple(:xmerl_xml)
+    |> to_string
 
     conn
     |> put_resp_content_type("application/atom+xml")
     |> send_resp(200, response)
   end
+
+  def salmon_incoming(conn, params) do
+    {:ok, body, _conn} = read_body(conn)
+    magic_key = Pleroma.Web.Salmon.fetch_magic_key(body)
+    {:ok, doc} = Pleroma.Web.Salmon.decode_and_validate(magic_key, body)
+
+    Pleroma.Web.OStatus.handle_incoming(doc)
+
+    conn
+    |> send_resp(200, "")
+  end
 end