@@ -21,6 +21,7 @@ import Utils
2121import System.Log.Logger
2222import Types
2323import System.Console.GetOpt
24+ import System.Console.GetOpt.Utils
2425import Data.List
2526import Download
2627import Control.Monad (when )
@@ -34,7 +35,10 @@ i = infoM "update"
3435update = simpleCmd " update" " Update your status"
3536 update_help
3637 [Option " r" [" recvmail" ] (NoArg (" m" , " " ))
37- " Receive update as body of email on stdin" ]
38+ " Receive update as body of email on stdin" ,
39+ Option " i" [" inreplyto" ] (ReqArg (stdRequired " i" ) " MSGID" )
40+ " Indicate this message is in reply to MSGID"
41+ ]
3842 update_worker
3943
4044update_worker x cp ([(" m" , " " )], [] ) =
@@ -59,9 +63,21 @@ update_worker x cp ([("m", "")], []) =
5963 ([(" source" , " twidge" ), (" status" , poststatus)] ++
6064 irt)
6165 debugM " update" $ " Got doc: " ++ xmlstr
66+
6267update_worker x cp ([] , [] ) =
6368 do l <- getLine
6469 update_worker x cp ([] , [l])
70+
71+ update_worker x cp ([(" i" , id )], [] ) =
72+ do l <- getLine
73+ update_worker x cp ([(" i" , id )], [l])
74+
75+ update_worker _ cp ([(" i" , id )], [status]) =
76+ do poststatus <- procStatus cp " update" status
77+ xmlstr <- sendAuthRequest cp " /statuses/update.xml" []
78+ [(" source" , " Twidge" ), (" status" , poststatus), (" in_reply_to_status_id" , id )]
79+ debugM " update" $ " Got doc: " ++ xmlstr
80+
6581update_worker _ cp ([] , [status]) =
6682 do poststatus <- procStatus cp " update" status
6783 xmlstr <- sendAuthRequest cp " /statuses/update.xml" []
0 commit comments