From: Simon Poole Date: Fri, 16 Aug 2013 18:54:38 +0000 (+0200) Subject: Add messages count to API response for logged in user details X-Git-Tag: live~5849 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/fc78f3c4a22b6a728fab614ebd2ade21590bb224?ds=inline Add messages count to API response for logged in user details Allows external editors to alert the user to the fact that they have unread messages on the OSM site. --- diff --git a/app/views/user/api_read.builder b/app/views/user/api_read.builder index 71bf29208..e97695420 100644 --- a/app/views/user/api_read.builder +++ b/app/views/user/api_read.builder @@ -41,6 +41,11 @@ xml.osm("version" => API_VERSION, "generator" => GENERATOR) do @this_user.languages.split(",") { |lang| xml.tag! "lang", lang } end end + xml.tag! "messages" do + xml.tag! "received", :count => @this_user.messages.size, + :unread => @this_user.new_messages.size + xml.tag! "sent", :count => @this_user.sent_messages.size + end end end end