+ with {:ok, follower, _followed, _} <- result do
+ options = cast_params(params)
+ set_reblogs_visibility(options[:reblogs], result)
+ set_subscription(options[:notify], result)
+ {:ok, follower}
+ end
+ end
+
+ defp set_reblogs_visibility(false, {:ok, follower, followed, _}) do
+ CommonAPI.hide_reblogs(follower, followed)
+ end
+
+ defp set_reblogs_visibility(_, {:ok, follower, followed, _}) do
+ CommonAPI.show_reblogs(follower, followed)
+ end
+
+ defp set_subscription(true, {:ok, follower, followed, _}) do
+ User.subscribe(follower, followed)
+ end