mirror of
https://github.com/neocities/neocities.git
synced 2025-04-28 11:12:30 +02:00
Support profile comments in site RSS feed
This commit is contained in:
parent
2cfc848ab2
commit
a216d043ac
1 changed files with 17 additions and 7 deletions
|
@ -1695,7 +1695,7 @@ class Site < Sequel::Model
|
|||
end
|
||||
|
||||
def to_rss
|
||||
site_change_events = events_dataset.exclude(is_deleted: true).exclude(site_change_id: nil).order(:created_at.desc).limit(10).all
|
||||
site_change_events = Event.news_feed_default_dataset.where(events__site_id: id).limit(10).all
|
||||
|
||||
Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
|
||||
xml.rss('version' => '2.0') {
|
||||
|
@ -1711,6 +1711,15 @@ class Site < Sequel::Model
|
|||
|
||||
site_change_events.each do |event|
|
||||
event_link = "https://neocities.org/site/#{username}?event_id=#{event.id.to_s}"
|
||||
if event.profile_comment_id
|
||||
xml.item {
|
||||
xml.title "#{event.actioning_site.username} has left a comment."
|
||||
xml.description event.profile_comment.message
|
||||
xml.link event_link
|
||||
xml.pubDate event.created_at.rfc822
|
||||
xml.guid event_link
|
||||
}
|
||||
else
|
||||
xml.item {
|
||||
xml.title "#{title} has been updated."
|
||||
xml.link event_link
|
||||
|
@ -1718,6 +1727,7 @@ class Site < Sequel::Model
|
|||
xml.guid event_link
|
||||
}
|
||||
end
|
||||
end
|
||||
}
|
||||
}
|
||||
end.to_xml
|
||||
|
|
Loading…
Add table
Reference in a new issue