[#210] Stylistic change.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 5 Dec 2018 17:23:28 +0000 (20:23 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Wed, 5 Dec 2018 17:23:28 +0000 (20:23 +0300)
lib/pleroma/web/activity_pub/activity_pub.ex

index 39692163f168363bab1ec6f3c7263e0de8ff53a5..4eb9d96abbae32c72f97e33557e417875c1c4a58 100644 (file)
@@ -574,7 +574,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
 
   def upload(file, opts \\ []) do
     with {:ok, data} <- Upload.store(file, opts) do
-      obj_data = if opts[:actor], do: Map.put(data, "actor", opts[:actor]), else: data
+      obj_data = (opts[:actor] && Map.put(data, "actor", opts[:actor])) || data
       Repo.insert(%Object{data: obj_data})
     end
   end