3 Jappix - An open social platform
4 These are the http-auth JS scripts for Jappix
6 -------------------------------------------------
10 Last revision: 16/11/10
14 // Replies to a HTTP request
15 function requestReply(value, xml) {
16 // We parse the xml content
17 var from = fullXID(getStanzaFrom(xml));
18 var confirm = $(xml.getNode()).find('confirm');
19 var xmlns = confirm.attr('xmlns');
20 var id = confirm.attr('id');
21 var method = confirm.attr('method');
22 var url = confirm.attr('url');
24 // We generate the reply message
25 var aMsg = new JSJaCMessage();
30 aMsg.setType('error');
31 aMsg.appendNode('error', {'code': '401', 'type': 'auth'});
34 // We set the confirm node
35 aMsg.appendNode('confirm', {'xmlns': xmlns, 'url': url, 'id': id, 'method': method});
37 // We send the message
38 con.send(aMsg, handleErrorReply);
40 logThis('Replying HTTP auth request: ' + from, 3);