Add liking to ActivityPub.
[akkoma] / lib / pleroma / web / twitter_api / twitter_api.ex
index 932bef5efa7a5127d14cc96bdbadb7550b7346a8..a195301ee27df99521097312d52beadb4bca1eec 100644 (file)
@@ -25,6 +25,8 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
 
     content_html = add_user_links(content, mentions)
 
+    date = make_date()
+
     activity = %{
       "type" => "Create",
       "to" => to,
@@ -33,11 +35,12 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
         "type" => "Note",
         "to" => to,
         "content" => content_html,
-        "published" => make_date,
+        "published" => date,
         "context" => context,
-        "attachment" => attachments
+        "attachment" => attachments,
+        "actor" => user.ap_id
       },
-      "published" => make_date,
+      "published" => date,
       "context" => context
     }
 
@@ -67,7 +70,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
   end
 
   def fetch_friend_statuses(user, opts \\ %{}) do
-    ActivityPub.fetch_activities(user.following, opts)
+    ActivityPub.fetch_activities([user.ap_id | user.following], opts)
     |> activities_to_statuses(%{for: user})
   end
 
@@ -106,7 +109,7 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
            "type" => "Follow",
            "actor" => follower.ap_id,
            "object" => followed.ap_id,
-           "published" => make_date
+           "published" => make_date()
          })
     do
       { :ok, follower, followed, activity }