You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
833 B

  1. class Api::StatusesController < ApiController
  2. before_action :doorkeeper_authorize!
  3. respond_to :json
  4. def show
  5. @status = Status.find(params[:id])
  6. end
  7. def create
  8. @status = PostStatusService.new.(current_user.account, params[:status], params[:in_reply_to_id].blank? ? nil : Status.find(params[:in_reply_to_id]))
  9. render action: :show
  10. end
  11. def reblog
  12. @status = ReblogService.new.(current_user.account, Status.find(params[:id]))
  13. render action: :show
  14. end
  15. def favourite
  16. @status = FavouriteService.new.(current_user.account, Status.find(params[:id])).status
  17. render action: :show
  18. end
  19. def home
  20. @statuses = Feed.new(:home, current_user.account).get(20, params[:max_id])
  21. end
  22. def mentions
  23. @statuses = Feed.new(:mentions, current_user.account).get(20, params[:max_id])
  24. end
  25. end