def post(user, %{status: _} = data) do
with {:ok, draft} <- ActivityDraft.create(user, data) do
- ActivityPub.create(draft.changes, draft.preview?)
+ activity = ActivityPub.create(draft.changes, draft.preview?)
+
+ unless draft.preview? do
+ Pleroma.Elasticsearch.maybe_put_into_elasticsearch(activity)
+ end
+
+ activity
end
end
else
{what, result} = error ->
Logger.warn(
- "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{
- activity_id
- }"
+ "CommonAPI.remove_mute/2 failed. #{what}: #{result}, user_id: #{user_id}, activity_id: #{activity_id}"
)
{:error, error}