The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
564 B

  1. class PostStatusService < BaseService
  2. # Post a text status update, fetch and notify remote users mentioned
  3. # @param [Account] account Account from which to post
  4. # @param [String] text Message
  5. # @param [Status] in_reply_to Optional status to reply to
  6. # @return [Status]
  7. def call(account, text, in_reply_to = nil)
  8. status = account.statuses.create!(text: text, thread: in_reply_to)
  9. process_mentions_service.(status)
  10. status
  11. end
  12. private
  13. def process_mentions_service
  14. @process_mentions_service ||= ProcessMentionsService.new
  15. end
  16. end