1.1 --- a/actions/SendMessage.py Thu Nov 14 18:40:34 2013 +0100
1.2 +++ b/actions/SendMessage.py Thu Nov 14 18:43:10 2013 +0100
1.3 @@ -12,7 +12,8 @@
1.4 from MoinMoin.Page import Page
1.5 from MoinMoin import config
1.6 from MoinMessage import GPG, MoinMessageError, Message, sendMessage, timestamp
1.7 -from MoinMessageSupport import get_signing_users, get_recipients, get_relays
1.8 +from MoinMessageSupport import get_signing_users, get_recipients, get_relays, \
1.9 + get_recipient_details, MoinMessageRecipientError
1.10 from MoinSupport import *
1.11 from ItemSupport import ItemStore
1.12 from MoinMoin.wikiutil import escape, MimeType, parseQueryString, \
1.13 @@ -274,24 +275,10 @@
1.14
1.15 # Get the recipient details.
1.16
1.17 - recipients = get_recipients(request)
1.18 - if not recipients:
1.19 - return 0, _("No recipients page is defined for MoinMessage.")
1.20 -
1.21 - recipient_details = recipients.get(recipient)
1.22 - if not recipient_details:
1.23 - return 0, _("The specified recipient is not present in the list of known contacts.")
1.24 -
1.25 - parameters = parseDictEntry(recipient_details, ("type", "location", "fingerprint",))
1.26 -
1.27 - if not parameters.has_key("type"):
1.28 - return 0, _("The recipient details are missing a destination type.")
1.29 -
1.30 - if not parameters.has_key("location"):
1.31 - return 0, _("The recipient details are missing a location for sent messages.")
1.32 -
1.33 - if parameters["type"] in ("url", "relay") and not parameters.has_key("fingerprint"):
1.34 - return 0, _("The recipient details are missing a fingerprint for sending messages.")
1.35 + try:
1.36 + parameters = get_recipient_details(request, recipient)
1.37 + except MoinMessageRecipientError, exc:
1.38 + return 0, exc.message
1.39
1.40 type = parameters["type"]
1.41 location = parameters["location"]