Class: StreamsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/streams_controller.rb

Overview

Copyright © 2010-2011, Diaspora Inc. This file is

licensed under the Affero General Public License version 3 or later.  See
the COPYRIGHT file.

Instance Method Summary collapse

Instance Method Details

#activityObject



36
37
38
# File 'app/controllers/streams_controller.rb', line 36

def activity
  stream_responder(Stream::Activity)
end

#aspectsObject



17
18
19
20
21
22
# File 'app/controllers/streams_controller.rb', line 17

def aspects
  aspect_ids = (session[:a_ids] || [])
  @stream = Stream::Aspect.new(current_user, aspect_ids,
                               :max_time => max_time)
  stream_responder
end

#commentedObject



50
51
52
# File 'app/controllers/streams_controller.rb', line 50

def commented
  stream_responder(Stream::Comments)
end

#followed_tagsObject



62
63
64
65
# File 'app/controllers/streams_controller.rb', line 62

def followed_tags
  gon.preloads[:tagFollowings] = tags
  stream_responder(Stream::FollowedTag)
end

#likedObject



54
55
56
# File 'app/controllers/streams_controller.rb', line 54

def liked
  stream_responder(Stream::Likes)
end

#local_publicObject



28
29
30
31
32
33
34
# File 'app/controllers/streams_controller.rb', line 28

def local_public
  if AppConfig.local_posts_stream?(current_user)
    stream_responder(Stream::LocalPublic)
  else
    head :not_found
  end
end

#mentionedObject



58
59
60
# File 'app/controllers/streams_controller.rb', line 58

def mentioned
  stream_responder(Stream::Mention)
end

#multiObject



40
41
42
43
44
45
46
47
48
# File 'app/controllers/streams_controller.rb', line 40

def multi
  if current_user.getting_started
    gon.preloads[:getting_started] = true
    inviter = current_user.invited_by.try(:person)
    gon.preloads[:mentioned_person] = {name: inviter.name, handle: inviter.diaspora_handle} if inviter
  end

  stream_responder(Stream::Multi)
end

#publicObject



24
25
26
# File 'app/controllers/streams_controller.rb', line 24

def public
  stream_responder(Stream::Public)
end