From fc78f3c4a22b6a728fab614ebd2ade21590bb224 Mon Sep 17 00:00:00 2001 From: Simon Poole Date: Fri, 16 Aug 2013 20:54:38 +0200 Subject: [PATCH] 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. --- app/views/user/api_read.builder | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.43.2