Comparison

core/stanza_router.lua @ 854:b9cfc9d5496a

core.stanza_router: Don't bounce errors to iq type=result/error
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Mar 2009 19:45:44 +0000
parent 848:b1f3977fd140
child 894:b61c3589cd7b
child 896:2c0b9e3c11c3
comparison
equal deleted inserted replaced
853:c0a40522041e 854:b9cfc9d5496a
271 reply.attr.from = to; 271 reply.attr.from = to;
272 origin.send(reply); 272 origin.send(reply);
273 end 273 end
274 -- TODO allow configuration of offline storage 274 -- TODO allow configuration of offline storage
275 -- TODO send error if not storing offline 275 -- TODO send error if not storing offline
276 elseif stanza.name == "iq" then 276 elseif stanza.name == "iq" and (stanza.attr.type == "get" or stanza.attr.type == "set") then
277 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); 277 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
278 end 278 end
279 else -- user does not exist 279 else -- user does not exist
280 -- TODO we would get here for nodeless JIDs too. Do something fun maybe? Echo service? Let plugins use xmpp:server/resource addresses? 280 -- TODO we would get here for nodeless JIDs too. Do something fun maybe? Echo service? Let plugins use xmpp:server/resource addresses?
281 if stanza.name == "presence" then 281 if stanza.name == "presence" then
282 local t = stanza.attr.type; 282 local t = stanza.attr.type;
283 if t == "subscribe" or t == "probe" then 283 if t == "subscribe" or t == "probe" then
284 origin.send(st.presence({from = to_bare, to = from_bare, type = "unsubscribed"})); 284 origin.send(st.presence({from = to_bare, to = from_bare, type = "unsubscribed"}));
285 end 285 end
286 -- else ignore 286 -- else ignore
287 else 287 elseif stanza.attr.type ~= "error" and (stanza.name ~= "iq" or stanza.attr.type ~= "result") then
288 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); 288 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
289 end 289 end
290 end 290 end
291 end 291 end
292 elseif origin.type == "c2s" then 292 elseif origin.type == "c2s" then