diff options
| author | Barry Warsaw | 2011-04-17 11:37:06 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2011-04-17 11:37:06 -0400 |
| commit | c2130f46808b3cf3cc27311d6d6f6b608e76b267 (patch) | |
| tree | f020d0d8034f0e21bc3f00787e5d3b7f447954e5 /src/mailman/interfaces/mailinglist.py | |
| parent | c894152772595a1acbd6dc4c1ac0e033888ea923 (diff) | |
| parent | e2ed3ae7dfa138a8288b4c49cd2b671c35f6c703 (diff) | |
| download | mailman-c2130f46808b3cf3cc27311d6d6f6b608e76b267.tar.gz mailman-c2130f46808b3cf3cc27311d6d6f6b608e76b267.tar.zst mailman-c2130f46808b3cf3cc27311d6d6f6b608e76b267.zip | |
IUsers can now have a preferred email address, which must be verified. A user
can now subscribe to a mailing list, in which case, their preferred address
will be used for the appropriate roster. Users cannot subscribe to a mailing
list more than once, but they can still subscribe even if their preferred
address is subscribed, and if a user is subscribed, an address they control
can still be explicitly subscribed.
Other changes:
* .subscribe() is moved from the IAddress to the IMailingList
* IUser.address and .user are now properties
* Added IUser.preferred_address which is a get/set/del property
Diffstat (limited to 'src/mailman/interfaces/mailinglist.py')
| -rw-r--r-- | src/mailman/interfaces/mailinglist.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mailman/interfaces/mailinglist.py b/src/mailman/interfaces/mailinglist.py index d8c0ebb26..23d21cd34 100644 --- a/src/mailman/interfaces/mailinglist.py +++ b/src/mailman/interfaces/mailinglist.py @@ -182,7 +182,7 @@ class IMailingList(Interface): def confirm_address(cookie=''): """The address used for various forms of email confirmation.""" - # Rosters. + # Rosters and subscriptions. owners = Attribute( """The IUser owners of this mailing list. @@ -232,6 +232,22 @@ class IMailingList(Interface): :rtype: Roster """ + def subscribe(subscriber, role): + """Subscribe the given address or user to the mailing list. + + :param subscriber: The address or user to subscribe to the mailing + list. The user's preferred address receives deliveries, if she + has one, otherwise no address for the user appears in the rosters. + :type subscriber: `IUser` or `IAddress` + :param role: The role being subscribed to (e.g. a member, owner, or + moderator of a mailing list. + :type role: `MemberRole` + :return: The member object representing the subscription. + :rtype: `IMember` + :raises AlreadySubscribedError: If the address or user is already + subscribed to the mailing list with the given role. + """ + # Posting history. last_post_at = Attribute( |
