2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
return unless event.visible_to_user?(current_user)
|
|
|
|
|
2019-12-04 20:38:33 +05:30
|
|
|
event = event.present
|
2021-09-04 01:27:46 +05:30
|
|
|
event_url = event_feed_url(event)
|
2019-12-04 20:38:33 +05:30
|
|
|
|
2016-06-16 23:09:34 +05:30
|
|
|
xml.entry do
|
|
|
|
xml.id "tag:#{request.host},#{event.created_at.strftime("%Y-%m-%d")}:#{event.id}"
|
2021-09-04 01:27:46 +05:30
|
|
|
xml.link href: event_url if event_url
|
2016-06-16 23:09:34 +05:30
|
|
|
xml.title truncate(event_feed_title(event), length: 80)
|
2017-08-17 22:00:37 +05:30
|
|
|
xml.updated event.updated_at.xmlschema
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
# We're deliberately re-using "event.author" here since this data is
|
|
|
|
# eager-loaded. This allows us to re-use the user object's Email address,
|
|
|
|
# instead of having to run additional queries to figure out what Email to use
|
|
|
|
# for the avatar.
|
2018-03-27 19:54:05 +05:30
|
|
|
xml.media :thumbnail, width: "40", height: "40", url: image_url(avatar_icon_for_user(event.author))
|
2016-06-16 23:09:34 +05:30
|
|
|
|
|
|
|
xml.author do
|
2017-08-17 22:00:37 +05:30
|
|
|
xml.username event.author_username
|
2016-06-16 23:09:34 +05:30
|
|
|
xml.name event.author_name
|
2017-08-17 22:00:37 +05:30
|
|
|
xml.email event.author_public_email
|
2016-06-16 23:09:34 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
xml.summary(type: "xhtml") do |summary|
|
|
|
|
event_summary = event_feed_summary(event)
|
|
|
|
|
|
|
|
summary << event_summary unless event_summary.nil?
|
|
|
|
end
|
|
|
|
end
|