about summary refs log tree commit diff
path: root/app/views/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-09-09 20:04:34 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-09-09 20:04:34 +0200
commit3cc47beb6e1f646baca64fdf56168e2f2e2bc726 (patch)
tree295d9442bec8fa7434b6a2c37a6cb835a3725dfd /app/views/api
parent735b4cc62e3fb9ef7a10b657c8e437ac0cb3d1fe (diff)
Refactored generation of unique tags, URIs and object URLs into own classes,
as well as formatting of content
Diffstat (limited to 'app/views/api')
-rw-r--r--app/views/api/accounts/show.rabl2
-rw-r--r--app/views/api/statuses/show.rabl6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/views/api/accounts/show.rabl b/app/views/api/accounts/show.rabl
index 4f7cee680..d779393d1 100644
--- a/app/views/api/accounts/show.rabl
+++ b/app/views/api/accounts/show.rabl
@@ -2,7 +2,7 @@ object @account
 
 attributes :id, :username, :acct, :display_name, :note
 
-node(:url)             { |account| url_for_target(account) }
+node(:url)             { |account| TagManager.instance.url_for(account) }
 node(:avatar)          { |account| full_asset_url(account.avatar.url(:large, false)) }
 node(:followers_count) { |account| account.followers.count }
 node(:following_count) { |account| account.following.count }
diff --git a/app/views/api/statuses/show.rabl b/app/views/api/statuses/show.rabl
index c7d028e14..047436b61 100644
--- a/app/views/api/statuses/show.rabl
+++ b/app/views/api/statuses/show.rabl
@@ -1,9 +1,9 @@
 object @status
 attributes :id, :created_at, :in_reply_to_id
 
-node(:uri)              { |status| uri_for_target(status) }
-node(:content)          { |status| content_for_status(status) }
-node(:url)              { |status| url_for_target(status) }
+node(:uri)              { |status| TagManager.instance.uri_for(status) }
+node(:content)          { |status| Formatter.instance.format(status) }
+node(:url)              { |status| TagManager.instance.url_for(status) }
 node(:reblogs_count)    { |status| status.reblogs_count }
 node(:favourites_count) { |status| status.favourites_count }
 node(:favourited)       { |status| current_account.favourited?(status) }