闭社主体 forked from https://github.com/tootsuite/mastodon
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.

27 lines
848 B

  1. # frozen_string_literal: true
  2. Nokogiri::XML::Builder.new do |xml|
  3. feed(xml) do
  4. simple_id xml, account_url(@account, format: 'atom')
  5. title xml, @account.display_name
  6. subtitle xml, @account.note
  7. updated_at xml, stream_updated_at
  8. logo xml, full_asset_url(@account.avatar.url(:original))
  9. author(xml) do
  10. include_author xml, @account
  11. end
  12. link_alternate xml, TagManager.instance.url_for(@account)
  13. link_self xml, account_url(@account, format: 'atom')
  14. link_next xml, account_url(@account, format: 'atom', max_id: @entries.last.id) if @entries.size == 20
  15. link_hub xml, api_push_url
  16. link_salmon xml, api_salmon_url(@account.id)
  17. @entries.each do |stream_entry|
  18. entry(xml, false) do
  19. include_entry xml, stream_entry
  20. end
  21. end
  22. end
  23. end.to_xml