Handle DomainChanged message.
This commit is contained in:
parent
04f9334f29
commit
ea2160b857
@ -684,8 +684,9 @@ handleAction = case _ of
|
||||
(DNSManager.MkInvalidZone _) -> do
|
||||
handleAction $ Log $ ErrorLog $ "InvalidZone"
|
||||
handleAction $ AddNotif $ BadNotification $ "The domain zone is invalid."
|
||||
(DNSManager.MkDomainChanged _) -> do
|
||||
handleAction $ Log $ ErrorLog $ "DomainChanged"
|
||||
m@(DNSManager.MkDomainChanged response) -> do
|
||||
handleAction $ Log $ SystemLog $ "Domain \"" <> response.domain.name <> "\" has been updated."
|
||||
handleAction $ DispatchDNSMessage m
|
||||
(DNSManager.MkUnknownZone _) -> do
|
||||
handleAction $ Log $ ErrorLog $ "UnknownZone"
|
||||
handleAction $ AddNotif $ BadNotification $ "The domain zone is unknown."
|
||||
|
@ -405,6 +405,10 @@ handleQuery = case _ of
|
||||
(DNSManager.MkDomainAdded response) -> do
|
||||
{ my_domains } <- H.get
|
||||
handleAction $ UpdateMyDomains (my_domains <> [ emptyDomainInfo { name = response.domain } ])
|
||||
(DNSManager.MkDomainChanged response) -> do
|
||||
{ my_domains } <- H.get
|
||||
let new_domains = map (\d -> if d.name == response.domain.name then response.domain else d) my_domains
|
||||
handleAction $ UpdateMyDomains new_domains
|
||||
(DNSManager.MkDomainDeleted response) -> do
|
||||
{ my_domains } <- H.get
|
||||
handleAction $ UpdateMyDomains $ A.filter (\d -> d.name /= response.domain) my_domains
|
||||
|
Loading…
Reference in New Issue
Block a user