diff options
author | David Baker <dave@matrix.org> | 2016-04-28 15:12:14 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-04-28 15:12:14 +0100 |
commit | 937c407eef78648f1c4c1afe56fdfd8598315b19 (patch) | |
tree | f6784f9b4c2c042397f12f368ed605d68a147f77 /synapse/push/pusher.py | |
parent | Handle room invites in email notifs (diff) | |
download | synapse-937c407eef78648f1c4c1afe56fdfd8598315b19.tar.xz |
Only import email pusher if email notifs are on
Diffstat (limited to '')
-rw-r--r-- | synapse/push/pusher.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/push/pusher.py b/synapse/push/pusher.py index f7c3021fcc..25a45af775 100644 --- a/synapse/push/pusher.py +++ b/synapse/push/pusher.py @@ -1,12 +1,14 @@ from httppusher import HttpPusher -from emailpusher import EmailPusher - -PUSHER_TYPES = { - 'http': HttpPusher, - 'email': EmailPusher, -} def create_pusher(hs, pusherdict): + PUSHER_TYPES = { + "http": HttpPusher, + } + + if hs.config.email_enable_notifs: + from emailpusher import EmailPusher + PUSHER_TYPES["email"] = EmailPusher + if pusherdict['kind'] in PUSHER_TYPES: return PUSHER_TYPES[pusherdict['kind']](hs, pusherdict) |