mirror of
https://github.com/element-hq/synapse
synced 2024-09-02 11:30:20 +00:00
Only import email pusher if email notifs are on
This commit is contained in:
parent
ebbabc4986
commit
937c407eef
1 changed files with 8 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue