]> cat aescling's git repositories - mastodon.git/commitdiff
Add "next" link to Atom feeds
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 13 Feb 2017 14:38:12 +0000 (15:38 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 13 Feb 2017 14:38:45 +0000 (15:38 +0100)
app/helpers/atom_builder_helper.rb
app/views/accounts/show.atom.ruby

index 484cf07931e2d52845e190ca11718aeed112eb4e..d73f09aaf60781338e73cb6214af76c2293f44ad 100644 (file)
@@ -90,6 +90,10 @@ module AtomBuilderHelper
     xml.link(rel: 'self', type: 'application/atom+xml', href: url)
   end
 
+  def link_next(xml, url)
+    xml.link(rel: 'next', type: 'application/atom+xml', href: url)
+  end
+
   def link_hub(xml, url)
     xml.link(rel: 'hub', href: url)
   end
index a225683960cf138606dfbc1aae938c961b250629..3832b8bdcbbbffbb20cdebbbd29de70e663bda50 100644 (file)
@@ -14,6 +14,7 @@ Nokogiri::XML::Builder.new do |xml|
 
     link_alternate xml, TagManager.instance.url_for(@account)
     link_self      xml, account_url(@account, format: 'atom')
+    link_next      xml, account_url(@account, format: 'atom', max_id: @entries.last.id) if @entries.size == 20
     link_hub       xml, api_push_url
     link_salmon    xml, api_salmon_url(@account.id)