Get fresh objects on changes.
authorRoger Braun <roger@rogerbraun.net>
Tue, 9 May 2017 16:11:11 +0000 (18:11 +0200)
committerRoger Braun <roger@rogerbraun.net>
Tue, 9 May 2017 16:11:11 +0000 (18:11 +0200)
This will count retweets / favs correctly again.

lib/pleroma/web/ostatus/ostatus.ex

index 8c1da09201a7be0be308890ac0c04697b05484dd..55d600ab2bee3bb4cf8914183b618fe46e5a697c 100644 (file)
@@ -51,7 +51,7 @@ defmodule Pleroma.Web.OStatus do
 
   def make_share(entry, doc, retweeted_activity) do
     with {:ok, actor} <- find_make_or_update_user(doc),
-         %Object{} = object <- Object.get_cached_by_ap_id(retweeted_activity.data["object"]["id"]),
+         %Object{} = object <- Object.get_by_ap_id(retweeted_activity.data["object"]["id"]),
          id when not is_nil(id) <- string_from_xpath("/entry/id", entry),
          {:ok, activity, _object} = ActivityPub.announce(actor, object, id, false) do
       {:ok, activity}
@@ -70,7 +70,7 @@ defmodule Pleroma.Web.OStatus do
 
   def make_favorite(entry, doc, favorited_activity) do
     with {:ok, actor} <- find_make_or_update_user(doc),
-         %Object{} = object <- Object.get_cached_by_ap_id(favorited_activity.data["object"]["id"]),
+         %Object{} = object <- Object.get_by_ap_id(favorited_activity.data["object"]["id"]),
          id when not is_nil(id) <- string_from_xpath("/entry/id", entry),
          {:ok, activity, _object} = ActivityPub.like(actor, object, id, false) do
       {:ok, activity}