Merge with upstream
This commit is contained in:
commit
25bb4afa80
60 changed files with 2177 additions and 1215 deletions
|
@ -1056,13 +1056,13 @@ module.exports.updateMessage = (message, status, updateSubscription, callback) =
|
|||
|
||||
let statusCode;
|
||||
if (status === 'unsubscribed') {
|
||||
statusCode = 2;
|
||||
}
|
||||
if (status === 'bounced') {
|
||||
statusCode = 3;
|
||||
}
|
||||
if (status === 'complained') {
|
||||
statusCode = 4;
|
||||
statusCode = subscriptions.Status.UNSUBSCRIBED;
|
||||
} else if (status === 'bounced') {
|
||||
statusCode = subscriptions.Status.BOUNCED;
|
||||
} else if (status === 'complained') {
|
||||
statusCode = subscriptions.Status.COMPLAINED;
|
||||
} else {
|
||||
return callback(new Error(_('Unrecognized message status')));
|
||||
}
|
||||
|
||||
let query = 'UPDATE `campaigns` SET `' + status + '`=`' + status + '`+1 WHERE id=? LIMIT 1';
|
||||
|
@ -1076,7 +1076,7 @@ module.exports.updateMessage = (message, status, updateSubscription, callback) =
|
|||
}
|
||||
|
||||
if (updateSubscription) {
|
||||
subscriptions.changeStatus(message.subscription, message.list, statusCode === 2 ? message.campaign : false, statusCode, callback);
|
||||
subscriptions.changeStatus(message.list, message.subscription, statusCode === subscriptions.Status.UNSUBSCRIBED ? message.campaign : false, statusCode, callback);
|
||||
} else {
|
||||
return callback(null, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue