- # TwitterAPI does not have an "unretweet" endpoint; instead this is done
- # via the "destroy" endpoint. Therefore, we need to handle
- # when the status to "delete" is actually an Announce (repeat) object.
- with %Activity{data: %{"type" => type}} <- Repo.get(Activity, id) do
- case type do
- "Announce" -> unrepeat(user, id)
- _ -> CommonAPI.delete(id, user)
- end
+ with %Activity{data: %{"type" => type}} <- Repo.get(Activity, id),
+ {:ok, activity} <- CommonAPI.delete(id, user) do
+ {:ok, activity}