Skip to content

Commit

Permalink
Merge pull request #578 from siddharthvp/csdnotifybug
Browse files Browse the repository at this point in the history
speedy/prod: don't log notification if that failed
  • Loading branch information
Amorymeltzer committed Apr 16, 2019
2 parents ad9b50c + 80767a7 commit 88f94e7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
21 changes: 14 additions & 7 deletions modules/twinkleprod.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,8 @@ Twinkle.prod.callbacks = {
}
var confirmtext = "A {{proposed deletion}} tag was already found on this page. \nWould you like to add a {{proposed deletion endorsed}} tag with your explanation?";
if (params.blp) {
confirmtext = "A non-BLP {{proposed deletion}} tag was found on this article.\nWould you like to add a {{proposed deletion endorsed}} tag with explanation \"article is a biography of a living person with no sources\"?";
// FIXME: this msg is shown even if it was a BLPPROD tag.
confirmtext = "A non-BLP {{proposed deletion}} tag was found on this article.\nWould you like to add a {{proposed deletion endorsed}} tag with explanation \"article is a biography of a living person with no sources\"?";
// FIXME: this msg is shown even if it was a BLPPROD tag.
}
if( !confirm( confirmtext ) ) {
statelem.warn( 'Aborted per user request' );
Expand Down Expand Up @@ -293,11 +293,18 @@ Twinkle.prod.callbacks = {
usertalkpage.setEditSummary("Notification: proposed deletion of [[:" + Morebits.pageNameNorm + "]]." + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
usertalkpage.append();
if (Twinkle.getPref('logProdPages')) {
params.logInitialContrib = initialContrib;
Twinkle.prod.callbacks.addToLog(params);
}
usertalkpage.append(function onNotifySuccess() {
// add nomination to the userspace log, if the user has enabled it
if (Twinkle.getPref('logProdPages')) {
params.logInitialContrib = initialContrib;
Twinkle.prod.callbacks.addToLog(params);
}
}, function onNotifyError() {
// if user could not be notified, log nomination without mentioning that notification was sent
if (Twinkle.getPref('logProdPages')) {
Twinkle.prod.callbacks.addToLog(params);
}
});
},

addToLog: function(params) {
Expand Down
17 changes: 12 additions & 5 deletions modules/twinklespeedy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1549,13 +1549,20 @@ Twinkle.speedy.callbacks = {
usertalkpage.setEditSummary(editsummary + Twinkle.getPref('summaryAd'));
usertalkpage.setCreateOption('recreate');
usertalkpage.setFollowRedirect(true);
usertalkpage.append();
usertalkpage.append(function onNotifySuccess() {
// add this nomination to the user's userspace log, if the user has enabled it
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, initialContrib);
}
}, function onNotifyError() {
// if user could not be notified, log nomination without mentioning that notification was sent
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, null);
}
});
}

// add this nomination to the user's userspace log, if the user has enabled it
if (params.lognomination) {
Twinkle.speedy.callbacks.user.addToLog(params, initialContrib);
}

};
var thispage = new Morebits.wiki.page(Morebits.pageNameNorm);
thispage.lookupCreator(callback);
Expand Down

0 comments on commit 88f94e7

Please sign in to comment.