diff --git a/app/controllers/public/content_viewer_controller.rb b/app/controllers/public/content_viewer_controller.rb index de1e5a2..84ccf9b 100644 --- a/app/controllers/public/content_viewer_controller.rb +++ b/app/controllers/public/content_viewer_controller.rb @@ -123,7 +123,6 @@ class ContentViewerController < ApplicationController plugins_filter_comment(@comment) return if @comment.rejected? if (pass_without_comment_captcha? || verify_recaptcha(:model => @comment, :message => _('Please type the words correctly'))) && @comment.save - plugins_comment_saved(@comment) @page.touch @comment = nil # clear the comment form redirect_to :action => 'view_page', :profile => params[:profile], :page => @page.explode_path, :view => params[:view] @@ -138,12 +137,6 @@ class ContentViewerController < ApplicationController end end - def plugins_comment_saved(comment) - @plugins.each do |plugin| - plugin.comment_saved(comment) - end - end - def pass_without_comment_captcha? logged_in? && !environment.enabled?('captcha_for_logged_users') end diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index 81e07dc..6db0ae9 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -232,12 +232,6 @@ class Noosfero::Plugin def filter_comment(comment) end - # This method will be called just after a comment has been saved to the - # database, so that a plugin can perform some action on it. - # - def comment_saved(comment) - end - # -> Adds fields to the signup form # returns = lambda block that creates html code def signup_extra_contents diff --git a/test/functional/content_viewer_controller_test.rb b/test/functional/content_viewer_controller_test.rb index 7d1423b..9da6370 100644 --- a/test/functional/content_viewer_controller_test.rb +++ b/test/functional/content_viewer_controller_test.rb @@ -1395,25 +1395,6 @@ class ContentViewerControllerTest < ActionController::TestCase end end - should 'notify plugins after a comment is saved' do - class TestNotifyCommentPlugin < Noosfero::Plugin - def comment_saved(c) - @__saved = c.id - @__title = c.title - end - attr_reader :__title - attr_reader :__saved - end - plugin = TestNotifyCommentPlugin.new - Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([plugin]) - page = profile.articles.create!(:name => 'myarticle', :body => 'the body of the text') - post :view_page, :profile => profile.identifier, :page => [ 'myarticle' ], :comment => { :title => 'the title of the comment', :body => 'body', :name => "Spammer", :email => 'damn@spammer.com' }, :confirm => 'true' - - assert_equal 'the title of the comment', plugin.__title - assert plugin.__saved - - end - should 'remove email from article followers when unfollow' do profile = create_user('testuser').person follower_email = 'john@doe.br' -- libgit2 0.21.2