diff options
author | eal <eal@waifu.club> | 2018-04-21 12:58:04 +0300 |
---|---|---|
committer | eal <eal@waifu.club> | 2018-04-21 12:58:04 +0300 |
commit | 22bfeac25612776fa7815573f175d6bf6b5537bd (patch) | |
tree | a142097d796c58233c47b97b1beb2d73d717fdd5 /lib | |
parent | d0b1c498a0c294e99160c01e8e43d6891b1922bc (diff) | |
download | pleroma-22bfeac25612776fa7815573f175d6bf6b5537bd.tar.gz |
Update note count in ActivityPub.create.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 3 | ||||
-rw-r--r-- | lib/pleroma/web/ostatus/handlers/note_handler.ex | 22 |
2 files changed, 11 insertions, 14 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 04b50c1cc..d071135c4 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -61,7 +61,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do additional ), {:ok, activity} <- insert(create_data, local), - :ok <- maybe_federate(activity) do + :ok <- maybe_federate(activity), + {:ok, actor} <- User.increase_note_count(actor) do {:ok, activity} end end diff --git a/lib/pleroma/web/ostatus/handlers/note_handler.ex b/lib/pleroma/web/ostatus/handlers/note_handler.ex index b012abd51..bd6e92238 100644 --- a/lib/pleroma/web/ostatus/handlers/note_handler.ex +++ b/lib/pleroma/web/ostatus/handlers/note_handler.ex @@ -138,19 +138,15 @@ defmodule Pleroma.Web.OStatus.NoteHandler do do: note |> Map.put("inReplyTo", inReplyTo), else: note ) do - res = - ActivityPub.create(%{ - to: to, - actor: actor, - context: context, - object: note, - published: date, - local: false, - additional: %{"cc" => cc} - }) - - User.increase_note_count(actor) - res + ActivityPub.create(%{ + to: to, + actor: actor, + context: context, + object: note, + published: date, + local: false, + additional: %{"cc" => cc} + }) else %Activity{} = activity -> {:ok, activity} e -> {:error, e} |