Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  # Send a public message.
def post
  @message = Message.new params[:message]
  @message.user = current_user
  # FIXME: Move empty check to browser side.
  if @message.has_text? && @message.save
    notice_stickie "Your message posted." 
    # Publish notice to subscribers.
      # Put into before_create will rollback if fail.
    @message.subscribers << current_user
    @message.subscribers << current_user.followers
    # FIXME: Twitter Gem NoMethodError: status.rb:11:in `new_from_xml.
      # Twitter status update.
      # notice_stickie "Has Twitter? #{current_user.has_twitter?}"
      # notice_stickie "not Updated? #{message.not_updated?}"
      # message.twitter_push
  end
  redirect_to :back
end