1.1 --- a/actions/SendMessage.py Sun Jul 21 22:40:31 2013 +0200
1.2 +++ b/actions/SendMessage.py Sun Jul 21 22:41:55 2013 +0200
1.3 @@ -12,9 +12,10 @@
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
1.8 from MoinSupport import *
1.9 from MoinMoin.wikiutil import escape, MimeType, parseQueryString, \
1.10 - taintfilename, getInterwikiHomePage
1.11 + taintfilename
1.12
1.13 from email.mime.base import MIMEBase
1.14 from email.mime.image import MIMEImage
1.15 @@ -69,7 +70,7 @@
1.16
1.17 # Get a list of potential recipients.
1.18
1.19 - recipients = self.get_recipients()
1.20 + recipients = get_recipients(request)
1.21
1.22 # Prepare the recipients list, selecting the specified recipients.
1.23
1.24 @@ -271,12 +272,12 @@
1.25 # This is not the same as the details for authenticating users in the
1.26 # PostMessage action since the fingerprints refer to public keys.
1.27
1.28 - signing_users = self.get_signing_users()
1.29 + signing_users = get_signing_users(request)
1.30 signer = signing_users and signing_users.get(request.user.name)
1.31
1.32 # Get the recipient details.
1.33
1.34 - recipients = self.get_recipients()
1.35 + recipients = get_recipients(request)
1.36 if not recipients:
1.37 return 0, _("No recipients page is defined for MoinMessage.")
1.38
1.39 @@ -341,37 +342,6 @@
1.40
1.41 return getattr(self.request.cfg, "moinmessage_gpg_homedir")
1.42
1.43 - def get_recipients(self):
1.44 -
1.45 - """
1.46 - Return the recipients dictionary by first obtaining the page in which it
1.47 - is stored. This page may either be a subpage of the user's home page, if
1.48 - stored on this wiki, or it may be relative to the site root.
1.49 -
1.50 - The name of the subpage is defined by the configuration setting
1.51 - 'moinmessage_gpg_recipients_page', which if absent is set to
1.52 - "MoinMessageRecipientsDict".
1.53 - """
1.54 -
1.55 - request = self.request
1.56 -
1.57 - subpage = getattr(request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict")
1.58 - homedetails = getInterwikiHomePage(request)
1.59 -
1.60 - if homedetails:
1.61 - homewiki, homepage = homedetails
1.62 - if homewiki == "Self":
1.63 - recipients = getWikiDict("%s/%s" % (homepage, subpage), request)
1.64 - if recipients:
1.65 - return recipients
1.66 -
1.67 - return getWikiDict(subpage, request)
1.68 -
1.69 - def get_signing_users(self):
1.70 - return getWikiDict(
1.71 - getattr(self.request.cfg, "moinmessage_gpg_signing_users_page", "MoinMessageSigningUserDict"),
1.72 - self.request)
1.73 -
1.74 # Special message formatters.
1.75
1.76 def unquoteWikinameURL(url, charset=config.charset):