]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/notes_controller.rb
Fix double XML declaration on trace RSS feeds
[rails.git] / app / controllers / notes_controller.rb
index 5ae136f29aac5c8ce3548cfb232e0d8ea761eb69..2973a26c27e187802d15f9a074ee4655f083c161 100644 (file)
@@ -9,7 +9,6 @@ class NotesController < ApplicationController
   before_action :check_api_writable, :only => [:create, :comment, :close, :reopen, :destroy]
   before_action :require_allow_write_notes, :only => [:create, :comment, :close, :reopen, :destroy]
   before_action :set_locale
-  after_action :compress_output
   around_action :api_call_handle_error, :api_call_timeout
 
   ##
@@ -284,7 +283,9 @@ class NotesController < ApplicationController
         @description = t "note.mine.subheading", :user => render_to_string(:partial => "user", :object => @this_user)
         @page = (params[:page] || 1).to_i
         @page_size = 10
-        @notes = @this_user.notes.order("updated_at DESC, id").uniq.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).to_a
+        @notes = @this_user.notes
+        @notes = @notes.visible unless @user && @user.moderator?
+        @notes = @notes.order("updated_at DESC, id").uniq.offset((@page - 1) * @page_size).limit(@page_size).preload(:comments => :author).to_a
       else
         @title = t "user.no_such_user.title"
         @not_found_user = params[:display_name]
@@ -300,17 +301,6 @@ class NotesController < ApplicationController
   # utility functions below.
   #------------------------------------------------------------
 
-  ##
-  # Render an OK response
-  def render_ok
-    if params[:format] == "js"
-      render :text => "osbResponse();", :content_type => "text/javascript"
-    else
-      render :text => "ok " + @note.id.to_s + "\n", :content_type => "text/plain" if @note
-      render :text => "ok\n", :content_type => "text/plain" unless @note
-    end
-  end
-
   ##
   # Get the maximum number of results to return
   def result_limit