diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 84a1f3381..923b73575 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -65,11 +65,11 @@ class StatusMessagesController < ApplicationController @status_message = current_user.my_posts.where(:_id => params[:id]).first if @status_message @status_message.destroy + render :nothing => true, :status => 200 else Rails.logger.info "event=post_destroy status=failure user=#{current_user.diaspora_handle} reason='User does not own post'" + render :nothing => true, :status => 404 end - - respond_with :location => root_url end def show diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index 2879064b9..8d0aa62a7 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -109,6 +109,11 @@ var Stream = { $(".new_comment").live('ajax:failure', function(data, html, xhr) { alert('failed to post message!'); }); + + $(".delete").live('ajax:success', function(data, html, xhr) { + $(this).parents(".message").fadeOut(150); + }); + }, toggleComments: function(evt) {