diff options
| author | Barry Warsaw | 2016-09-08 19:49:00 +1200 |
|---|---|---|
| committer | Barry Warsaw | 2016-09-08 19:49:00 +1200 |
| commit | 447b9bd6df0113ca7e2332d6ad20c01691f3ce07 (patch) | |
| tree | 637eff5c4d0923ae801e225ef0ce09a9821e2642 /src/mailman/interfaces/subscriptions.py | |
| parent | 54ae6bb8c78998c533b75d81c3b3e72151813d9e (diff) | |
| download | mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.tar.gz mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.tar.zst mailman-447b9bd6df0113ca7e2332d6ad20c01691f3ce07.zip | |
Diffstat (limited to 'src/mailman/interfaces/subscriptions.py')
| -rw-r--r-- | src/mailman/interfaces/subscriptions.py | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/mailman/interfaces/subscriptions.py b/src/mailman/interfaces/subscriptions.py index 62f5be627..9a20b9c0d 100644 --- a/src/mailman/interfaces/subscriptions.py +++ b/src/mailman/interfaces/subscriptions.py @@ -224,6 +224,28 @@ class ISubscriptionManager(Interface): :param subscriber: The user or address to subscribe. :type email: ``IUser`` or ``IAddress`` + :param pre_verified: A flag indicating whether the subscriber's email + address should be considered pre-verified. Normally a never + before seen email address must be verified by mail-back + confirmation. Setting this flag to True automatically verifies + such addresses without the mail-back. (A confirmation message may + still be sent under other conditions.) + :type pre_verified: bool + :param pre_confirmed: A flag indicating whether, when required by the + subscription policy, a subscription request should be considered + pre-confirmed. Normally in such cases, a mail-back confirmation + message is sent to the subscriber, which must be positively + acknowledged by some manner. Setting this flag to True + automatically confirms the subscription request. (A confirmation + message may still be sent under other conditions.) + :type pre_confirmed: bool + :param pre_approved: A flag indicating whether, when required by the + subscription policy, a subscription request should be considered + pre-approved. Normally in such cases, the list administrator is + notified that an approval is necessary, which must be positively + acknowledged in some manner. Setting this flag to True + automatically approves the subscription request. + :type pre_approved: bool :return: A 3-tuple is returned where the first element is the token hash, the second element is a ``TokenOwner`, and the third element is the subscribed member. If the subscriber got subscribed @@ -235,6 +257,47 @@ class ISubscriptionManager(Interface): appears in the global or list-centric bans. """ + def unregister(subscriber=None, *, + pre_confirmed=False, pre_approved=False): + """Unsubscribe an address or user according to subscription policies. + + The mailing list's unsubscription policy is used to unsubscribe + `subscriber` from the given mailing list. The subscriber can be + an ``IUser`` or an ``IAddress``, and must already be subscribed to the + mailing list. + + The workflow may pause (i.e. be serialized, saved, and + suspended) when some out-of-band confirmation step is required. + For example, if the user must confirm, or the moderator must + approve the unsubscription. Use the ``confirm(token)`` method to + resume the workflow. + + :param subscriber: The user or address to unsubscribe. + :type email: ``IUser`` or ``IAddress`` + :param pre_confirmed: A flag indicating whether, when required by the + unsubscription policy, an unsubscription request should be + considered pre-confirmed. Normally in such cases, a mail-back + confirmation message is sent to the subscriber, which must be + positively acknowledged by some manner. Setting this flag to True + automatically confirms the unsubscription request. (A confirmation + message may still be sent under other conditions.) + :type pre_confirmed: bool + :param pre_approved: A flag indicating whether, when required by the + unsubscription policy, an unsubscription request should be + considered pre-approved. Normally in such cases, the list + administrator is notified that an approval is necessary, which + must be positively acknowledged in some manner. Setting this flag + to True automatically approves the unsubscription request. + :type pre_approved: bool + :return: A 3-tuple is returned where the first element is the token + hash, the second element is a ``TokenOwner`, and the third element + is the unsubscribing member. If the subscriber got unsubscribed + immediately, the token will be None and the member will be + an ``IMember``. If the unsubscription got held, the token + will be a hash and the member will be None. + :rtype: (str-or-None, ``TokenOwner``, ``IMember``-or-None) + """ + def confirm(token): """Continue any paused workflow. |
