* flag notifications will go to the flag details page instead of the post or user that was flag
* if you assign a flag to yourself you won't get a notification about it
@benlubar
This commit is contained in:
Barış Soner Uşaklı
2018-09-18 17:28:24 -04:00
parent 3c89befad2
commit dff86b1ac9

View File

@@ -497,7 +497,7 @@ Flags.update = function (flagId, uid, changeset, callback) {
var tasks = [];
var now = changeset.datetime || Date.now();
var notifyAssignee = function (assigneeId, next) {
if (assigneeId === '') {
if (assigneeId === '' || parseInt(uid, 10) === parseInt(assigneeId, 10)) {
// Do nothing
return next();
}
@@ -689,7 +689,7 @@ Flags.notify = function (flagObj, uid, callback) {
bodyShort: '[[notifications:user_flagged_post_in, ' + flagObj.reporter.username + ', ' + titleEscaped + ']]',
bodyLong: flagObj.description,
pid: flagObj.targetId,
path: '/post/' + flagObj.targetId,
path: '/flags/' + flagObj.flagId,
nid: 'flag:post:' + flagObj.targetId + ':uid:' + uid,
from: uid,
mergeId: 'notifications:user_flagged_post_in|' + flagObj.targetId,
@@ -726,7 +726,7 @@ Flags.notify = function (flagObj, uid, callback) {
type: 'new-user-flag',
bodyShort: '[[notifications:user_flagged_user, ' + flagObj.reporter.username + ', ' + flagObj.target.username + ']]',
bodyLong: flagObj.description,
path: '/uid/' + flagObj.targetId,
path: '/flags/' + flagObj.flagId,
nid: 'flag:user:' + flagObj.targetId + ':uid:' + uid,
from: uid,
mergeId: 'notifications:user_flagged_user|' + flagObj.targetId,