packages feed

hzulip 0.4.1.0 → 0.4.2.0

raw patch · 2 files changed

+10/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ HZulip: addSubscriptions :: ZulipClient -> [String] -> IO ()

Files

hzulip.cabal view
@@ -1,5 +1,5 @@ name:                hzulip-version:             0.4.1.0+version:             0.4.2.0 synopsis:            A haskell wrapper for the Zulip API. description:         This a Zulip API wrapper for Haskell. homepage:            https://github.com/yamadapc/hzulip
src/HZulip.hs view
@@ -6,6 +6,7 @@               , ZulipClient(..)               , EventCallback               , MessageCallback+              , addSubscriptions               , defaultBaseUrl               , eventTypes               , getEvents@@ -23,6 +24,7 @@ import Control.Concurrent (threadDelay) import Control.Exception (SomeException, handle) import Control.Lens ((.~), (&), (^.), (^..))+import Control.Monad (void) import Data.Aeson.Lens (key, values, _String) import qualified Data.ByteString.Char8 as BS (pack) import qualified Data.Text as T (pack, unpack)@@ -113,6 +115,13 @@     r <- getWith (reqOptions z) (subscriptionsUrl z)     return $ map T.unpack $ r ^.. responseBody . key "subscriptions"                                 . values . key "name" . _String++-- |+-- Add new Stream subscriptions to the client.+addSubscriptions :: ZulipClient -> [String] -> IO ()+addSubscriptions z sbs = do+    let form = [ "subscriptions" := show sbs ]+    void $ postWith (reqOptions z) (subscriptionsUrl z) form  -- | -- Fetches new set of events from a `Queue`.