packages feed

pubnub 1.1.0 → 1.1.1

raw patch · 3 files changed

+13/−18 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

pubnub.cabal view
@@ -2,24 +2,21 @@ -- see http://haskell.org/cabal/users-guide/  name:                   pubnub-version:                1.1.0+version:                1.1.1 synopsis:               PubNub Haskell SDK-description:            The PubNub Network makes Real-time easy with a Simple Communications API. Two Functions: Send/Receive (Publish/Subscribe). We provide a web-service API for businesses to build scalable Data Push communication apps on Mobile, Tablet and Web. Bidirectional JSON.+description:            The PubNub Network makes Real-time easy with a Simple Communications API. Two Functions: Send and Receive (Publish and Subscribe). We provide a web-service API for businesses to build scalable Data Push communication apps on Mobile, Tablet and Web. Bidirectional JSON. homepage:               http://github.com/pubnub/haskell license:                MIT license-file:           LICENSE author:                 Tristan Sloughter maintainer:             t@crashfast.com--- copyright: category:               Cloud, API build-type:             Simple--- extra-source-files: cabal-version:          >=1.10  library   exposed-modules:      Network.Pubnub, Network.Pubnub.Types-  -- other-modules:-  -- other-extensions:+   build-depends:        base >=4.6 && <4.7                         , aeson >= 0.7.0.0                         , conduit >= 1.1.0.2
src/Network/Pubnub.hs view
@@ -81,7 +81,7 @@       let req = buildSubscribeRequest pn' "0"       eres <- try $ httpLbs req manager       case eres of-        Right res -> do+        Right res ->           case decode $ responseBody res of             Just (ConnectResponse ([], t)) -> do               liftIO (if isReconnect@@ -106,9 +106,9 @@       case eres of         Right res -> do           case (ctx pn', iv pn') of-            (Just c, Just i) -> do+            (Just c, Just i) ->               responseBody res $$+- encryptedSubscribeSink c i-            (_, _) -> do+            (_, _) ->               responseBody res $$+- subscribeSink           reconnect pn' manager         Left (ResponseTimeout :: HttpException) ->@@ -121,7 +121,7 @@           reconnect pn' manager      encryptedSubscribeSink c i =-      awaitForever $ (\x ->+      awaitForever (\x ->                        case decode (L.fromStrict x) of                          Just (EncryptedSubscribeResponse (resp, _)) -> do                            _ <- liftIO $ mapM (onMsg subOpts . decodeEncrypted c i) resp@@ -130,7 +130,7 @@                            return ())      subscribeSink =-      awaitForever $ (\x ->+      awaitForever (\x ->                        case decode (L.fromStrict x) of                          Just (SubscribeResponse (resp, _)) -> do                            _ <- liftIO $ mapM (onMsg subOpts) resp@@ -215,8 +215,7 @@                             , encodeUtf8 $ sub_key pn                             , "channel"                             , encodeUtf8 channel]-            ((convertHistoryOptions options) ++-             (userIdOptions pn))+            (convertHistoryOptions options ++ userIdOptions pn)             Nothing   res <- withManager $ httpLbs req   return (decode $ responseBody res)@@ -250,12 +249,12 @@ grant = pamDo "grant"  auth :: PN -> T.Text -> PN-auth pn k = pn{auth_key = (Just k)}+auth pn k = pn{auth_key = Just k}  pamDo :: B.ByteString -> PN -> Auth -> IO (Maybe Value) pamDo pamMethod pn authR = do   ts <- (bsFromInteger . round) <$> getPOSIXTime-  let req = buildRequest pn pamURI ((pamQS ts) ++ [("signature", signature ts)]) Nothing+  let req = buildRequest pn pamURI (pamQS ts ++ [("signature", signature ts)]) Nothing   res <- withManager $ httpLbs req   return (decode $ responseBody res)   where@@ -291,8 +290,8 @@ -- internal functions userIdOptions :: PN -> [(B.ByteString, B.ByteString)] userIdOptions pn =-  (maybe [] (\u -> [("uuid", encodeUtf8 u)]) (uuid_key pn)) ++-  (maybe [] (\a -> [("auth", encodeUtf8 a)]) (auth_key pn))+  maybe [] (\u -> [("uuid", encodeUtf8 u)]) (uuid_key pn) +++  maybe [] (\a -> [("auth", encodeUtf8 a)]) (auth_key pn)  buildRequest :: PN -> [B.ByteString] -> SimpleQuery -> Maybe Int -> Request buildRequest pn elems qs timeout =
src/Network/Pubnub/Types.hs view
@@ -34,7 +34,6 @@ import Data.Text.Read import Data.Aeson import Data.Aeson.TH-import Data.Aeson.Types  import Crypto.Cipher.AES import Crypto.Cipher.Types