rename 'enable_private_email_messages' to 'enable_personal_email_messages'

This commit is contained in:
Arpit Jalan 2018-01-31 11:34:50 +05:30
parent ff0376a80b
commit 7e48c47d37
5 changed files with 7 additions and 5 deletions

View File

@ -1038,7 +1038,7 @@ en:
enable_personal_messages: "Allow trust level 1 (configurable via min trust level to send messages) users to create messages and reply to messages. Note that staff can always send messages no matter what."
enable_system_message_replies: "Allows users to reply to system messages, even if private messages are disabled"
enable_private_email_messages: "Allow trust level 4 (configurable via min trust level to send messages) users to send private email messages. Note that staff can always send messages no matter what."
enable_personal_email_messages: "Allow trust level 4 (configurable via min trust level to send messages) users to send private email messages. Note that staff can always send messages no matter what."
enable_long_polling: "Message bus used for notification can use long polling"
long_polling_base_url: "Base URL used for long polling (when a CDN is serving dynamic content, be sure to set this to origin pull) eg: http://origin.site.com"

View File

@ -510,7 +510,7 @@ posting:
client: true
enable_system_message_replies:
default: true
enable_private_email_messages:
enable_personal_email_messages:
default: false
client: true
validator: "EnablePrivateEmailMessagesValidator"

View File

@ -8,11 +8,13 @@ class RenamePrivatePersonal < ActiveRecord::Migration[5.1]
setting :min_private_message_post_length, :min_personal_message_post_length
setting :min_private_message_title_length, :min_personal_message_title_length
setting :enable_private_messages, :enable_personal_messages
setting :enable_private_email_messages, :enable_personal_email_messages
end
def down
setting :min_private_message_post_length, :min_personal_message_post_length
setting :min_private_message_title_length, :min_personal_message_title_length
setting :enable_private_messages, :enable_personal_messages
setting :enable_private_email_messages, :enable_personal_email_messages
end
end

View File

@ -320,7 +320,7 @@ class Guardian
# User is trusted enough
@user.has_trust_level?(SiteSetting.min_trust_to_send_email_messages) &&
# PMs to email addresses are enabled
(is_staff? || SiteSetting.enable_private_email_messages)
(is_staff? || SiteSetting.enable_personal_email_messages)
end
def can_see_emails?

View File

@ -80,7 +80,7 @@ describe TopicCreator do
end
it "should be possible for a trusted user to send private messages via email" do
SiteSetting.expects(:enable_private_email_messages).returns(true)
SiteSetting.expects(:enable_personal_email_messages).returns(true)
SiteSetting.min_trust_to_send_email_messages = TrustLevel[1]
expect(TopicCreator.create(user, Guardian.new(user), pm_to_email_valid_attrs)).to be_valid
@ -89,7 +89,7 @@ describe TopicCreator do
context 'failure cases' do
it "should be rollback the changes when email is invalid" do
SiteSetting.expects(:enable_private_email_messages).returns(true)
SiteSetting.expects(:enable_personal_email_messages).returns(true)
SiteSetting.min_trust_to_send_email_messages = TrustLevel[1]
attrs = pm_to_email_valid_attrs.dup
attrs[:target_emails] = "t" * 256