diff --git a/app/assets/javascripts/discourse/controllers/user.js.es6 b/app/assets/javascripts/discourse/controllers/user.js.es6 index 757779abe..83c7c4ec9 100644 --- a/app/assets/javascripts/discourse/controllers/user.js.es6 +++ b/app/assets/javascripts/discourse/controllers/user.js.es6 @@ -23,7 +23,11 @@ export default Ember.Controller.extend(CanCheckEmails, { return this.get('model.trust_level') > 2 && !this.siteSettings.tl3_links_no_follow; }.property('model.trust_level'), - canSeePrivateMessages: Ember.computed.or('viewingSelf', 'currentUser.admin'), + @computed('viewSelf', 'currentUser.admin') + canSeePrivateMessages(viewingSelf, isAdmin) { + return this.siteSettings.enable_private_messages && (viewingSelf || isAdmin); + }, + canSeeNotificationHistory: Em.computed.alias('canSeePrivateMessages'), showBadges: function() { diff --git a/app/assets/javascripts/discourse/templates/components/user-menu.hbs b/app/assets/javascripts/discourse/templates/components/user-menu.hbs index fa0b578e6..bba85df8d 100644 --- a/app/assets/javascripts/discourse/templates/components/user-menu.hbs +++ b/app/assets/javascripts/discourse/templates/components/user-menu.hbs @@ -8,7 +8,10 @@ {{/if}}
  • {{d-link path=bookmarksPath title="user.bookmarks" icon="bookmark"}} - {{d-link path=messagesPath title="user.private_messages" icon="envelope"}} + {{log siteSettings}} + {{#if siteSettings.enable_private_messages}} + {{d-link path=messagesPath title="user.private_messages" icon="envelope"}} + {{/if}} {{#if showEnableAnon}} {{d-link action="toggleAnon" title="switch_to_anon" icon="user-secret"}} {{/if}} diff --git a/config/site_settings.yml b/config/site_settings.yml index 78f4b7b14..754e067b8 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -374,7 +374,9 @@ posting: min_body_similar_length: client: true default: 15 - enable_private_messages: true + enable_private_messages: + default: true + client: true ninja_edit_window: 300 post_edit_time_limit: 86400 edit_history_visible_to_public: