|
|
@ -336,7 +336,10 @@ Flags.create = function (type, id, uid, reason, timestamp, callback) {
|
|
|
|
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byTargetUid:' + targetUid, timestamp, flagId)); // by target uid
|
|
|
|
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byTargetUid:' + targetUid, timestamp, flagId)); // by target uid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (targetCid) {
|
|
|
|
if (targetCid) {
|
|
|
|
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byCid:' + targetCid, timestamp, flagId)); // by target uid
|
|
|
|
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byCid:' + targetCid, timestamp, flagId)); // by target cid
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type === 'post') {
|
|
|
|
|
|
|
|
tasks.push(async.apply(db.sortedSetAdd.bind(db), 'flags:byPid:' + id, timestamp, flagId)); // by target pid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
async.parallel(tasks, function (err, data) {
|
|
|
|
async.parallel(tasks, function (err, data) {
|
|
|
|