# HG changeset patch # User Paul Boddie # Date 1390693601 -3600 # Node ID b94b5b5ba162a7d1ec42a3369692005cf47baa3b # Parent 3315bed653f6a5d36e0e88d8198f9835552bf319 Fixed recipient filtering by parsing the details of each recipient. Fixed an incomplete docstring describing the permitted actions of a user. Added a variable containing the supported recipient parameters. diff -r 3315bed653f6 -r b94b5b5ba162 MoinMessageSupport.py --- a/MoinMessageSupport.py Sun Jan 26 00:44:09 2014 +0100 +++ b/MoinMessageSupport.py Sun Jan 26 00:46:41 2014 +0100 @@ -20,7 +20,7 @@ from email.parser import Parser import time -Dependencies = ['pages'] +RECIPIENT_PARAMETERS = ("type", "location", "fingerprint") class MoinMessageAction: @@ -344,7 +344,7 @@ """ For the user associated with the 'request', return the permitted actions for - the user in the form of + the user in the form of a list of "action:pagename" identifiers. """ if not request.user or not request.user.valid: @@ -387,7 +387,7 @@ if not recipient_details: raise MoinMessageUnknownRecipient, _("The specified recipient is not present in the list of known contacts.") - parameters = parseDictEntry(recipient_details, ("type", "location", "fingerprint",)) + parameters = parseDictEntry(recipient_details, RECIPIENT_PARAMETERS) type = parameters.get("type") location = parameters.get("location") @@ -412,12 +412,16 @@ """ result = {} - for recipient, parameters in recipients.items(): + for recipient, details in recipients.items(): + parameters = parseDictEntry(details, RECIPIENT_PARAMETERS) + if not fetching and parameters.get("type") in (None, "none"): continue if not sending and not parameters.get("fingerprint"): continue - result[recipient] = parameters + + result[recipient] = details + return result # vim: tabstop=4 expandtab shiftwidth=4