Skip to content

Commit

Permalink
Add messages count to API response for logged in user details
Browse files Browse the repository at this point in the history
Allows external editors to alert the user to the fact that they
have unread messages on the OSM site.
  • Loading branch information
simonpoole authored and tomhughes committed Aug 16, 2013
1 parent 2fed3f0 commit fc78f3c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/views/user/api_read.builder
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fc78f3c

Please sign in to comment.