Comparison

core/stanza_router.lua @ 250:9f66ede8deeb

Added error replies for unhandled stanzas
author Waqas Hussain <waqas20@gmail.com>
date Thu, 13 Nov 2008 19:14:31 +0500
parent 249:1fc47cf5d144
child 257:762274c98040
comparison
equal deleted inserted replaced
249:1fc47cf5d144 250:9f66ede8deeb
171 end 171 end
172 end 172 end
173 end 173 end
174 stanza.attr.to = nil; -- reset it 174 stanza.attr.to = nil; -- reset it
175 else 175 else
176 -- TODO error, bad type 176 log("warn", "Unhandled c2s presence: %s", tostring(stanza));
177 end 177 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error?
178 end
179 else
180 log("warn", "Unhandled c2s stanza: %s", tostring(stanza));
181 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error?
178 end -- TODO handle other stanzas 182 end -- TODO handle other stanzas
179 else 183 else
180 log("warn", "Unhandled origin: %s", origin.type); -- FIXME reply with error 184 log("warn", "Unhandled origin: %s", origin.type);
185 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error?
181 end 186 end
182 end 187 end
183 188
184 function send_presence_of_available_resources(user, host, jid, recipient_session) 189 function send_presence_of_available_resources(user, host, jid, recipient_session)
185 local h = hosts[host]; 190 local h = hosts[host];