Parse bounce and hello events correctly

This commit is contained in:
Joscha 2020-01-09 16:18:06 +00:00
parent 10cad5e576
commit a2668cdd2c

View file

@ -227,8 +227,8 @@ data BounceEvent = BounceEvent
instance FromJSON BounceEvent where instance FromJSON BounceEvent where
parseJSON = fromPacket "bounce-event" $ \o -> BounceEvent parseJSON = fromPacket "bounce-event" $ \o -> BounceEvent
<$> o .: "reason" <$> o .:? "reason"
<*> o .: "auth_options" <*> o .:? "auth_options" .!= []
{- disconnect-event -} {- disconnect-event -}
@ -253,7 +253,7 @@ data HelloEvent = HelloEvent
instance FromJSON HelloEvent where instance FromJSON HelloEvent where
parseJSON = fromPacket "hello-event" $ \o -> HelloEvent parseJSON = fromPacket "hello-event" $ \o -> HelloEvent
<$> o .: "account" <$> o .:? "account"
<*> o .: "session" <*> o .: "session"
<*> o .:? "account_has_access" <*> o .:? "account_has_access"
<*> o .:? "account_email_verified" <*> o .:? "account_email_verified"