diff options
Diffstat (limited to 'app/views/api')
-rw-r--r-- | app/views/api/v1/statuses/_media.rabl | 1 | ||||
-rw-r--r-- | app/views/api/v1/statuses/show.rabl | 10 |
2 files changed, 6 insertions, 5 deletions
diff --git a/app/views/api/v1/statuses/_media.rabl b/app/views/api/v1/statuses/_media.rabl index 5c6be1ce7..2f56c6d07 100644 --- a/app/views/api/v1/statuses/_media.rabl +++ b/app/views/api/v1/statuses/_media.rabl @@ -2,3 +2,4 @@ attributes :id, :remote_url, :type node(:url) { |media| full_asset_url(media.file.url(:original)) } node(:preview_url) { |media| full_asset_url(media.file.url(:small)) } +node(:text_url) { |media| media.local? ? medium_url(media) : nil } diff --git a/app/views/api/v1/statuses/show.rabl b/app/views/api/v1/statuses/show.rabl index 1b4651cdd..41e8983ef 100644 --- a/app/views/api/v1/statuses/show.rabl +++ b/app/views/api/v1/statuses/show.rabl @@ -2,12 +2,12 @@ object @status extends 'api/v1/statuses/_show' -node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? !!@favourites_map[status.id] : current_account.favourited?(status) } -node(:reblogged, if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map) ? !!@reblogs_map[status.id] : current_account.reblogged?(status) } +node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? @favourites_map[status.id] : current_account.favourited?(status) } +node(:reblogged, if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map) ? @reblogs_map[status.id] : current_account.reblogged?(status) } -child :reblog => :reblog do +child reblog: :reblog do extends 'api/v1/statuses/_show' - node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? !!@favourites_map[status.id] : current_account.favourited?(status) } - node(:reblogged, if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map) ? !!@reblogs_map[status.id] : current_account.reblogged?(status) } + node(:favourited, if: proc { !current_account.nil? }) { |status| defined?(@favourites_map) ? @favourites_map[status.id] : current_account.favourited?(status) } + node(:reblogged, if: proc { !current_account.nil? }) { |status| defined?(@reblogs_map) ? @reblogs_map[status.id] : current_account.reblogged?(status) } end |