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.

37 lines
1.2 KiB

  1. Nokogiri::XML::Builder.new do |xml|
  2. entry(xml, true) do
  3. unique_id xml, @entry.created_at, @entry.activity_id, @entry.activity_type
  4. published_at xml, @entry.activity.created_at
  5. updated_at xml, @entry.activity.updated_at
  6. title xml, @entry.title
  7. content xml, @entry.content
  8. verb xml, @entry.verb
  9. author(xml) do
  10. object_type xml, :person
  11. uri xml, profile_url(name: @entry.account.username)
  12. name xml, @entry.account.username
  13. summary xml, @entry.account.note
  14. link_alternate xml, profile_url(name: @entry.account.username)
  15. portable_contact xml, @entry.account
  16. end
  17. if @entry.targeted?
  18. target(xml) do
  19. object_type xml, @entry.target.object_type
  20. simple_id xml, @entry.target.uri
  21. title xml, @entry.target.title
  22. summary xml, @entry.target.summary
  23. link_alternate xml, @entry.target.uri
  24. if @entry.target.object_type == :person
  25. portable_contact xml, @entry.target
  26. end
  27. end
  28. else
  29. object_type xml, @entry.object_type
  30. end
  31. link_self xml, atom_entry_url(id: @entry.id)
  32. end
  33. end