about summary refs log tree commit diff
path: root/app/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-02-26 20:48:20 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-02-26 20:48:20 +0100
commit24646d57690ad36cf4caecab2eec5774bca7f699 (patch)
treee6118271d38a47edb6b7518ff5dacedb76cbf7f9 /app/api
parentf16b31f0773c2fd1122ff0ad98cb392e762f0d0b (diff)
Adding views for the profile and entry pages
Diffstat (limited to 'app/api')
-rw-r--r--app/api/mastodon/entities.rb4
-rw-r--r--app/api/mastodon/rest.rb8
2 files changed, 11 insertions, 1 deletions
diff --git a/app/api/mastodon/entities.rb b/app/api/mastodon/entities.rb
index 975e72538..1c0e768f8 100644
--- a/app/api/mastodon/entities.rb
+++ b/app/api/mastodon/entities.rb
@@ -46,5 +46,9 @@ module Mastodon
         expose :updated_at
       end
     end
+
+    class StreamEntry < Grape::Entity
+      expose :activity, using: Mastodon::Entities::Status
+    end
   end
 end
diff --git a/app/api/mastodon/rest.rb b/app/api/mastodon/rest.rb
index 25a53202b..eb5232165 100644
--- a/app/api/mastodon/rest.rb
+++ b/app/api/mastodon/rest.rb
@@ -3,6 +3,12 @@ module Mastodon
     version 'v1', using: :path
     format :json
 
+    helpers do
+      def current_user
+        User.first
+      end
+    end
+
     resource :timelines do
       desc 'Return a public timeline'
 
@@ -13,7 +19,7 @@ module Mastodon
       desc 'Return the home timeline of a logged in user'
 
       get :home do
-        # todo
+        present current_user.timeline, with: Mastodon::Entities::StreamEntry
       end
 
       desc 'Return the notifications timeline of a logged in user'