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

@@ -69,7 +69,9 @@ function executeCommand(socket, command, eventName, notification, data, callback
websockets.in(data.room_id).emit('event:' + eventName, result);
}
if (result && notification) {
if (result && command === 'upvote') {
socketHelpers.upvote(result, notification);
} else if (result && notification) {
socketHelpers.sendNotificationToPostOwner(data.pid, socket.uid, command, notification);
} else if (result && command === 'unvote') {
socketHelpers.rescindUpvoteNotification(data.pid, socket.uid);