1.1 --- a/actions/SendMessage.py Sat Jun 08 01:21:27 2013 +0200
1.2 +++ b/actions/SendMessage.py Sat Jun 08 01:22:06 2013 +0200
1.3 @@ -13,7 +13,8 @@
1.4 from MoinMoin import config
1.5 from MoinMessage import GPG, MoinMessageError, Message, sendMessage
1.6 from MoinSupport import *
1.7 -from MoinMoin.wikiutil import escape, MimeType, parseQueryString, taintfilename
1.8 +from MoinMoin.wikiutil import escape, MimeType, parseQueryString, \
1.9 + taintfilename, getInterwikiHomePage
1.10
1.11 from email.mime.image import MIMEImage
1.12 from email.mime.multipart import MIMEMultipart
1.13 @@ -253,9 +254,30 @@
1.14 return getattr(self.request.cfg, "moinmessage_gpg_homedir")
1.15
1.16 def get_recipients(self):
1.17 - return getWikiDict(
1.18 - getattr(self.request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict"),
1.19 - self.request)
1.20 +
1.21 + """
1.22 + Return the recipients dictionary by first obtaining the page in which it
1.23 + is stored. This page may either be a subpage of the user's home page, if
1.24 + stored on this wiki, or it may be relative to the site root.
1.25 +
1.26 + The name of the subpage is defined by the configuration setting
1.27 + 'moinmessage_gpg_recipients_page', which if absent is set to
1.28 + "MoinMessageRecipientsDict".
1.29 + """
1.30 +
1.31 + request = self.request
1.32 +
1.33 + subpage = getattr(request.cfg, "moinmessage_gpg_recipients_page", "MoinMessageRecipientsDict")
1.34 + homedetails = getInterwikiHomePage(request)
1.35 +
1.36 + if homedetails:
1.37 + homewiki, homepage = homedetails
1.38 + if homewiki == "Self":
1.39 + recipients = getWikiDict("%s/%s" % (homepage, subpage), request)
1.40 + if recipients:
1.41 + return recipients
1.42 +
1.43 + return getWikiDict(subpage, request)
1.44
1.45 def get_signing_users(self):
1.46 return getWikiDict(