Upvote notification frequency selection (#6087)

Closes #5963

- Notify on every upvote
- Notify on every tenth upvote
- Notify logarithmically (on 10, 100, 1000...)
- Disable upvote notifications
This commit is contained in:
Peter Jaszkowiak
2017-11-21 12:14:14 -07:00
committed by Julian Lam
parent 3fd25257e0
commit 74ceb78800
6 changed files with 71 additions and 6 deletions

View File

@@ -74,8 +74,7 @@ module.exports = function (User) {
settings.categoryTopicSort = getSetting(settings, 'categoryTopicSort', 'newest_to_oldest');
settings.followTopicsOnCreate = parseInt(getSetting(settings, 'followTopicsOnCreate', 1), 10) === 1;
settings.followTopicsOnReply = parseInt(getSetting(settings, 'followTopicsOnReply', 0), 10) === 1;
settings.sendChatNotifications = parseInt(getSetting(settings, 'sendChatNotifications', 0), 10) === 1;
settings.sendPostNotifications = parseInt(getSetting(settings, 'sendPostNotifications', 0), 10) === 1;
settings.upvoteNotifFreq = getSetting(settings, 'upvoteNotifFreq', 'all');
settings.restrictChat = parseInt(getSetting(settings, 'restrictChat', 0), 10) === 1;
settings.topicSearchEnabled = parseInt(getSetting(settings, 'topicSearchEnabled', 0), 10) === 1;
settings.delayImageLoading = parseInt(getSetting(settings, 'delayImageLoading', 1), 10) === 1;
@@ -131,6 +130,7 @@ module.exports = function (User) {
notificationSound: data.notificationSound,
incomingChatSound: data.incomingChatSound,
outgoingChatSound: data.outgoingChatSound,
upvoteNotifFreq: data.upvoteNotifFreq,
notificationType_upvote: data.notificationType_upvote,
'notificationType_new-topic': data['notificationType_new-topic'],
'notificationType_new-reply': data['notificationType_new-reply'],