Comparison

core/stanza_router.lua @ 967:b021403c5d80

Fixed: Send correct error reply for IQs directed at unavailable resources
author Waqas Hussain <waqas20@gmail.com>
date Tue, 07 Apr 2009 02:32:49 +0500
parent 966:d2692d427496
child 1008:da7691ebec9c
child 1143:5bab3eb566ad
comparison
equal deleted inserted replaced
966:d2692d427496 967:b021403c5d80
242 if count == 0 and (stanza.attr.type == "chat" or stanza.attr.type == "normal" or not stanza.attr.type) then 242 if count == 0 and (stanza.attr.type == "chat" or stanza.attr.type == "normal" or not stanza.attr.type) then
243 offlinemanager.store(node, host, stanza); 243 offlinemanager.store(node, host, stanza);
244 -- TODO deal with storage errors 244 -- TODO deal with storage errors
245 end 245 end
246 end 246 end
247 else 247 elseif stanza.attr.type == "get" or stanza.attr.type == "set" then
248 -- TODO send IQ error 248 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
249 end 249 end
250 else 250 else
251 -- User + resource is online... 251 -- User + resource is online...
252 stanza.attr.to = res.full_jid; -- reset at the end of function 252 stanza.attr.to = res.full_jid; -- reset at the end of function
253 res.send(stanza); -- Yay \o/ 253 res.send(stanza); -- Yay \o/