Added the newmail_hook

When new mail arrives, this hook is triggered, allowing the user to
play a sound, or launch a popup.

Signed-off-by: Matthew Krafczyk <krafczyk.matthew@gmail.com>
This commit is contained in:
Matthew Krafczyk
2015-01-27 18:56:54 +01:00
parent ca1ce256ec
commit 48bb2f4113
4 changed files with 35 additions and 0 deletions

View File

@ -36,6 +36,11 @@ class IMAPRepository(BaseRepository):
self._host = None
self.imapserver = imapserver.IMAPServer(self)
self.folders = None
# Only set the newmail_hook in an IMAP repository.
if self.config.has_option(self.getsection(), 'newmail_hook'):
self.newmail_hook = self.localeval.eval(
self.getconf('newmail_hook'))
if self.getconf('sep', None):
self.ui.info("The 'sep' setting is being ignored for IMAP "
"repository '%s' (it's autodetected)"% self)