From bf9d3c45b6b35e799adf5beb66cb69fea97b89ad Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Thu, 21 Nov 2002 05:35:18 +0000 Subject: process(): Set the `respond' flag to false if - this is a subscription being confirmed and send_welcome_msg is true - this is an unsub being confirmed and send_goodbye_msg is true We don't need redundant responses. --- Mailman/Commands/cmd_confirm.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Mailman/Commands/cmd_confirm.py b/Mailman/Commands/cmd_confirm.py index c2f147f9e..5e4fc701b 100644 --- a/Mailman/Commands/cmd_confirm.py +++ b/Mailman/Commands/cmd_confirm.py @@ -22,6 +22,7 @@ from Mailman import mm_cfg from Mailman import Errors +from Mailman import Pending from Mailman.i18n import _ STOP = 1 @@ -63,15 +64,21 @@ Your request has been forwarded to the list moderator for approval.""")) You are not current a member. Have you already unsubscribed or changed your email address?""")) else: - res.results.append(_('Confirmation succeeded')) - # Consume any other confirmation strings with the same cookie so the - # user doesn't get a misleading "unprocessed" message. - match = 'confirm ' + cookie - unprocessed = [] - for line in res.commands: - if line.lstrip() == match: - continue - unprocessed.append(line) - res.commands = unprocessed + if ((results[0] == Pending.SUBSCRIPTION and mlist.send_welcome_msg) + or + (results[0] == Pending.UNSUBSCRIPTION and mlist.send_goodbye_msg)): + # We don't also need to send a confirmation succeeded message + res.respond = 0 + else: + res.results.append(_('Confirmation succeeded')) + # Consume any other confirmation strings with the same cookie so + # the user doesn't get a misleading "unprocessed" message. + match = 'confirm ' + cookie + unprocessed = [] + for line in res.commands: + if line.lstrip() == match: + continue + unprocessed.append(line) + res.commands = unprocessed # Process just one confirmation string per message return STOP -- cgit v1.3.1