-- | If the given Message is not Nothing, send a copy of it for every
-- Status in the list.
-send_messages :: Maybe Message -> [Status] -> IO ()
-send_messages maybe_message statuses =
+send_messages :: Cfg -> Maybe Message -> [Status] -> IO ()
+send_messages cfg maybe_message statuses =
case maybe_message of
Nothing -> return ()
Just message -> do
default_date <- rfc822_now
let mfs = message_from_status message (default_date)
let messages = map mfs statuses
- sendmail_results <- mapM sendmail messages
+ sendmail_results <- mapM sendmail' messages
_ <- mapM print_sendmail_result sendmail_results
return ()
-
-
+ where
+ sendmail' = sendmail (sendmail_path cfg)
-- | Display the number of skipped replies if ignore_replies is true
-- and verbose is enabled.
_ <- mapM (putStrLn . pretty_print) good_statuses
- send_messages maybe_message good_statuses
+ send_messages cfg maybe_message good_statuses
let new_latest_status_id = get_max_status_id new_statuses
do_recurse new_latest_status_id
-- | A debugging tool that will parse, print, and email a single
-- status (given by its id).
-twat_single_status :: Integer -> (Maybe Message) -> IO ()
-twat_single_status the_status_id maybe_message = do
+twat_single_status :: Cfg -> Integer -> (Maybe Message) -> IO ()
+twat_single_status cfg the_status_id maybe_message = do
xmldata <- get_status the_status_id
-- Parsing an empty result can blow up. Just pretend there are
Just message -> do
default_date <- rfc822_now
let messages = map (message_from_status message (default_date)) statuses
- sendmail_results <- mapM sendmail messages
+ sendmail_results <- mapM sendmail' messages
_ <- mapM print_sendmail_result sendmail_results
return ()
+ where
+ sendmail' = sendmail (sendmail_path cfg)
\ No newline at end of file