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
1.3 KiB

  1. object @status
  2. attributes :id, :created_at, :in_reply_to_id
  3. node(:uri) { |status| TagManager.instance.uri_for(status) }
  4. node(:content) { |status| Formatter.instance.format(status) }
  5. node(:url) { |status| TagManager.instance.url_for(status) }
  6. node(:reblogs_count) { |status| status.reblogs_count }
  7. node(:favourites_count) { |status| status.favourites_count }
  8. node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? !!@favourites_map[status.id] : current_account.favourited?(status) }
  9. node(:reblogged, if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map) ? !!@reblogs_map[status.id] : current_account.reblogged?(status) }
  10. child :reblog => :reblog do
  11. extends('api/v1/statuses/show')
  12. end
  13. child :account do
  14. extends('api/v1/accounts/show')
  15. end
  16. child :media_attachments, object_root: false do
  17. attributes :id, :remote_url, :type
  18. node(:url) { |media| full_asset_url(media.file.url) }
  19. node(:preview_url) { |media| full_asset_url(media.file.url(:small)) }
  20. end
  21. child :mentions, object_root: false do
  22. node(:url) { |mention| TagManager.instance.url_for(mention.account) }
  23. node(:acct) { |mention| mention.account.acct }
  24. node(:id) { |mention| mention.account_id }
  25. end