Parse bounce and hello events correctly
This commit is contained in:
parent
10cad5e576
commit
a2668cdd2c
1 changed files with 3 additions and 3 deletions
|
|
@ -227,8 +227,8 @@ data BounceEvent = BounceEvent
|
|||
|
||||
instance FromJSON BounceEvent where
|
||||
parseJSON = fromPacket "bounce-event" $ \o -> BounceEvent
|
||||
<$> o .: "reason"
|
||||
<*> o .: "auth_options"
|
||||
<$> o .:? "reason"
|
||||
<*> o .:? "auth_options" .!= []
|
||||
|
||||
{- disconnect-event -}
|
||||
|
||||
|
|
@ -253,7 +253,7 @@ data HelloEvent = HelloEvent
|
|||
|
||||
instance FromJSON HelloEvent where
|
||||
parseJSON = fromPacket "hello-event" $ \o -> HelloEvent
|
||||
<$> o .: "account"
|
||||
<$> o .:? "account"
|
||||
<*> o .: "session"
|
||||
<*> o .:? "account_has_access"
|
||||
<*> o .:? "account_email_verified"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue