--------------------------------------------------------------------
-- |
-- Module      : FriendFeed.Subscribe
-- Description : Control subscriptions to users and rooms.
-- Copyright   : (c) Sigbjorn Finne, 2008
-- License     : BSD3
--
-- Maintainer: Sigbjorn Finne <sof@forkIO.com>
-- Stability : provisional
-- Portability: portable
--
-- Binding to FriendFeed API controlling subscriptions to rooms
-- and other users.
-- 
--------------------------------------------------------------------
module FriendFeed.Subscribe where

import FriendFeed.Types
import FriendFeed.Types.Import ()
import FriendFeed.Monad

subscribeUser :: UserName -> FFm ()
subscribeUser u = authCall $ 
  ffeedCall_ ["user",u,"subscribe"] []

unsubscribeUser :: UserName -> FFm ()
unsubscribeUser u = authCall $ 
  ffeedCall_ ["user",u,"subscribe"] [("unsubscribe","1")]

subscribeRoom :: RoomName -> FFm ()
subscribeRoom r = authCall $ 
  ffeedCall_ ["room",r,"subscribe"] []

unsubscribeRoom :: RoomName -> FFm ()
unsubscribeRoom r = authCall $ 
  ffeedCall_ ["room",r,"subscribe"] [("unsubscribe","1")]