-- | Sends an IQ, returns Just a 'TMVar' that will be filled with the first
-- inbound IQ with a matching ID that has type @result@ or @error@ or Nothing if
-- the stanza could not be sent
sendIQ::MaybeInt-- ^ Timeout . When the timeout is reached the response
-- TMVar will be filled with 'IQResponseTimeout' and the id
-- is removed from the list of IQ handlers. 'Nothing'
sendIQ::MaybeInteger-- ^ Timeout . When the timeout is reached the response
-- TMVar will be filled with 'IQResponseTimeout' and the
-- id is removed from the list of IQ handlers. 'Nothing'
-- deactivates the timeout
->MaybeJid-- ^ Recipient (to)
->IQRequestType-- ^ IQ type (@Get@ or @Set@)
@ -26,7 +28,7 @@ sendIQ :: Maybe Int -- ^ Timeout . When the timeout is reached the response
@@ -26,7 +28,7 @@ sendIQ :: Maybe Int -- ^ Timeout . When the timeout is reached the response
-- default)
->Element-- ^ The IQ body (there has to be exactly one)
@ -41,7 +43,7 @@ sendIQ timeOut to tp lang body session = do -- TODO: Add timeout
@@ -41,7 +43,7 @@ sendIQ timeOut to tp lang body session = do -- TODO: Add timeout
casetimeOutof
Nothing->return()
Justt->void.forkIO$do
threadDelayt
delayt
doTimeOut(iqHandlerssession)newIdref
return$Justref
elsereturnNothing
@ -53,16 +55,16 @@ sendIQ timeOut to tp lang body session = do -- TODO: Add timeout
@@ -53,16 +55,16 @@ sendIQ timeOut to tp lang body session = do -- TODO: Add timeout
writeTVarhandlers(byNS,Map.deleteiqidbyId)
return()
-- | Like 'sendIQ', but waits for the answer IQ. Times out after 30 seconds