about summary refs log tree commit diff
path: root/app/views/api/v1/statuses
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-05 15:25:55 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-05 15:25:55 +0100
commit87830f99e7e47f19ce9368cca93b66a8c1c34517 (patch)
tree649f1cf1ee158d26f7f4726bbfad06b263141d5b /app/views/api/v1/statuses
parentff2da21d3c889b797ad58a0ff4fae150f195b016 (diff)
Fix #552 - Replace image links with image icons in status text in the UI
Diffstat (limited to 'app/views/api/v1/statuses')
-rw-r--r--app/views/api/v1/statuses/_media.rabl1
-rw-r--r--app/views/api/v1/statuses/show.rabl10
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