diff options
-rw-r--r-- | alot/commands/thread.py | 6 | ||||
-rw-r--r-- | docs/source/configuration/hooks.rst | 8 |
2 files changed, 10 insertions, 4 deletions
diff --git a/alot/commands/thread.py b/alot/commands/thread.py index 3fbe8148..e3c15b2e 100644 --- a/alot/commands/thread.py +++ b/alot/commands/thread.py @@ -139,7 +139,8 @@ class ReplyCommand(Command): timestamp = self.message.get_date() qf = settings.get_hook('reply_prefix') if qf: - quotestring = qf(name, address, timestamp, ui=ui, dbm=ui.dbman) + quotestring = qf(name, address, timestamp, + message=mail, ui=ui, dbm=ui.dbman) else: quotestring = 'Quoting %s (%s)\n' % (name or address, timestamp) mailcontent = quotestring @@ -346,7 +347,8 @@ class ForwardCommand(Command): timestamp = self.message.get_date() qf = settings.get_hook('forward_prefix') if qf: - quote = qf(name, address, timestamp, ui=ui, dbm=ui.dbman) + quote = qf(name, address, timestamp, + message=mail, ui=ui, dbm=ui.dbman) else: quote = 'Forwarded message from %s (%s):\n' % ( name or address, timestamp) diff --git a/docs/source/configuration/hooks.rst b/docs/source/configuration/hooks.rst index 5d201328..be8972b3 100644 --- a/docs/source/configuration/hooks.rst +++ b/docs/source/configuration/hooks.rst @@ -42,7 +42,7 @@ Other Hooks Apart from command pre- and posthooks, the following hooks will be interpreted: -.. py:function:: reply_prefix(realname, address, timestamp[, ui= None, dbm=None]) +.. py:function:: reply_prefix(realname, address, timestamp[, message=None, ui= None, dbm=None]) Is used to reformat the first indented line in a reply message. This defaults to 'Quoting %s (%s)\n' % (realname, timestamp)' unless this @@ -54,9 +54,11 @@ Apart from command pre- and posthooks, the following hooks will be interpreted: :type address: str :param timestamp: value of the Date header of the replied message :type timestamp: :obj:`datetime.datetime` + :param message: message object attached to reply + :type message: :obj:`email.Message` :rtype: string -.. py:function:: forward_prefix(realname, address, timestamp[, ui= None, dbm=None]) +.. py:function:: forward_prefix(realname, address, timestamp[, message=None, ui= None, dbm=None]) Is used to reformat the first indented line in a inline forwarded message. This defaults to 'Forwarded message from %s (%s)\n' % (realname, @@ -68,6 +70,8 @@ Apart from command pre- and posthooks, the following hooks will be interpreted: :type address: str :param timestamp: value of the Date header of the replied message :type timestamp: :obj:`datetime.datetime` + :param message: message object being forwarded + :type message: :obj:`email.Message` :rtype: string .. _pre-edit-translate: |