diff --git a/install/data/defaults.json b/install/data/defaults.json index 811ffa243bb7..d8ae3a488f27 100644 --- a/install/data/defaults.json +++ b/install/data/defaults.json @@ -116,6 +116,7 @@ "hideEmail": 0, "allowGuestHandles": 0, "guestsIncrementTopicViews": 1, + "allowGuestReplyNotifications": 1, "incrementTopicViewsInterval": 60, "recentMaxTopics": 200, "disableRecentCategoryFilter": 0, diff --git a/public/language/en-GB/admin/settings/guest.json b/public/language/en-GB/admin/settings/guest.json index 3ba81aa778e6..75d44f37e41f 100644 --- a/public/language/en-GB/admin/settings/guest.json +++ b/public/language/en-GB/admin/settings/guest.json @@ -1,7 +1,7 @@ { - "handles": "Guest Handles", + "settings": "Settings", "handles.enabled": "Allow guest handles", "handles.enabled-help": "This option exposes a new field that allows guests to pick a name to associate with each post they make. If disabled, they will simply be called \"Guest\"", - "topic-views": "Topic views", - "topic-views.enabled": "Allow guests to increase topic view counts" + "topic-views.enabled": "Allow guests to increase topic view counts", + "reply-notifications.enabled": "Allow guests to generate reply notifications" } \ No newline at end of file diff --git a/src/topics/create.js b/src/topics/create.js index afa8498b7233..ca55a8066e31 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -187,12 +187,14 @@ module.exports = function (Topics) { user.setUserField(uid, 'lastonline', Date.now()); } - Topics.notifyFollowers(postData, uid, { - type: 'new-reply', - bodyShort: translator.compile('notifications:user_posted_to', postData.user.username, postData.topic.title), - nid: 'new_post:tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + uid, - mergeId: 'notifications:user_posted_to|' + postData.topic.tid, - }); + if (parseInt(uid, 10) || meta.config.allowGuestReplyNotifications) { + Topics.notifyFollowers(postData, uid, { + type: 'new-reply', + bodyShort: translator.compile('notifications:user_posted_to', postData.user.username, postData.topic.title), + nid: 'new_post:tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + uid, + mergeId: 'notifications:user_posted_to|' + postData.topic.tid, + }); + } analytics.increment(['posts', 'posts:byCid:' + data.cid]); plugins.fireHook('action:topic.reply', { post: _.clone(postData), data: data }); diff --git a/src/views/admin/settings/guest.tpl b/src/views/admin/settings/guest.tpl index 368f384b794f..3adaf9917c5a 100644 --- a/src/views/admin/settings/guest.tpl +++ b/src/views/admin/settings/guest.tpl @@ -1,7 +1,7 @@
-
[[admin/settings/guest:handles]]
+
[[admin/settings/guest:settings]]
@@ -14,9 +14,6 @@ [[admin/settings/guest:handles.enabled-help]]

-
-
[[admin/settings/guest:topic-views]]
-
+
+
+ +
+