2016-02-22 10:11:07 -08:00
|
|
|
Nokogiri::XML::Builder.new do |xml|
|
2016-02-23 04:08:01 -08:00
|
|
|
entry(xml, true) do
|
|
|
|
unique_id xml, @entry.created_at, @entry.activity_id, @entry.activity_type
|
|
|
|
published_at xml, @entry.activity.created_at
|
|
|
|
updated_at xml, @entry.activity.updated_at
|
|
|
|
title xml, @entry.title
|
|
|
|
content xml, @entry.content
|
|
|
|
verb xml, @entry.verb
|
2016-02-22 10:11:07 -08:00
|
|
|
|
2016-02-23 04:08:01 -08:00
|
|
|
author(xml) do
|
|
|
|
object_type xml, :person
|
|
|
|
uri xml, profile_url(name: @entry.account.username)
|
|
|
|
name xml, @entry.account.username
|
|
|
|
summary xml, @entry.account.note
|
|
|
|
link_alternate xml, profile_url(name: @entry.account.username)
|
|
|
|
portable_contact xml, @entry.account
|
2016-02-22 10:11:07 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
if @entry.targeted?
|
2016-02-23 04:08:01 -08:00
|
|
|
target(xml) do
|
|
|
|
object_type xml, @entry.target.object_type
|
|
|
|
simple_id xml, @entry.target.uri
|
|
|
|
title xml, @entry.target.title
|
|
|
|
summary xml, @entry.target.summary
|
|
|
|
link_alternate xml, @entry.target.uri
|
|
|
|
|
|
|
|
if @entry.target.object_type == :person
|
|
|
|
portable_contact xml, @entry.target
|
|
|
|
end
|
2016-02-22 10:11:07 -08:00
|
|
|
end
|
|
|
|
else
|
2016-02-23 04:08:01 -08:00
|
|
|
object_type xml, @entry.object_type
|
2016-02-22 10:11:07 -08:00
|
|
|
end
|
|
|
|
|
2016-02-23 04:08:01 -08:00
|
|
|
link_self xml, atom_entry_url(id: @entry.id)
|
2016-02-22 10:11:07 -08:00
|
|
|
end
|
2016-02-23 04:08:01 -08:00
|
|
|
end
|