mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
FEATURE: new "disable_edit_notifications" site setting
Should be used whenever you activate the "download_remote_images_to_local" site setting to prevent users from receiving a lot of edit notifications from the system user.
This commit is contained in:
parent
f822491886
commit
ce732d2252
4 changed files with 13 additions and 0 deletions
|
@ -41,6 +41,7 @@ class PostAlertObserver < ActiveRecord::Observer
|
||||||
post = post_revision.post
|
post = post_revision.post
|
||||||
|
|
||||||
return unless post
|
return unless post
|
||||||
|
return if SiteSetting.disable_edit_notifications
|
||||||
return if post_revision.user.blank?
|
return if post_revision.user.blank?
|
||||||
return if post_revision.user_id == post.user_id
|
return if post_revision.user_id == post.user_id
|
||||||
return if post.topic.private_message?
|
return if post.topic.private_message?
|
||||||
|
|
|
@ -889,6 +889,8 @@ en:
|
||||||
|
|
||||||
global_notice: "Display an URGENT, EMERGENCY global banner notice to all visitors, change to blank to hide it (HTML allowed)."
|
global_notice: "Display an URGENT, EMERGENCY global banner notice to all visitors, change to blank to hide it (HTML allowed)."
|
||||||
|
|
||||||
|
disable_edit_notifications: "Used to disable edit notifications when you activate the 'download_remote_images_to_local' site setting."
|
||||||
|
|
||||||
enable_names: "Allow users to show their full names"
|
enable_names: "Allow users to show their full names"
|
||||||
display_name_on_posts: "Also show a user's full name on their posts"
|
display_name_on_posts: "Also show a user's full name on their posts"
|
||||||
invites_shown: "Maximum invites shown on a user page"
|
invites_shown: "Maximum invites shown on a user page"
|
||||||
|
|
|
@ -598,3 +598,5 @@ uncategorized:
|
||||||
enable_system_avatars:
|
enable_system_avatars:
|
||||||
hidden: true
|
hidden: true
|
||||||
default: true
|
default: true
|
||||||
|
|
||||||
|
disable_edit_notifications: false
|
||||||
|
|
|
@ -38,6 +38,14 @@ describe PostAlertObserver do
|
||||||
post.revise(evil_trout, "world is the new body of the message")
|
post.revise(evil_trout, "world is the new body of the message")
|
||||||
}.should change(post.user.notifications, :count).by(1)
|
}.should change(post.user.notifications, :count).by(1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not notifiy a user of the revision when edit notifications are disabled' do
|
||||||
|
SiteSetting.stubs(:disable_edit_notifications).returns(true)
|
||||||
|
lambda {
|
||||||
|
post.revise(evil_trout, "world is the new body of the message")
|
||||||
|
}.should_not change(post.user.notifications, :count).by(1)
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'private message' do
|
context 'private message' do
|
||||||
|
|
Loading…
Reference in a new issue