comparison util.js @ 32:b15e1581c3d4

Allow iq error to not have a <text/>.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 23 Dec 2018 20:08:40 +0100
parents 9ba4f8cc32f1
children 021185105e2f
comparison
equal deleted inserted replaced
31:e561bdd81777 32:b15e1581c3d4
60 return null; 60 return null;
61 const condition = error.firstChild; 61 const condition = error.firstChild;
62 if (condition.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas') 62 if (condition.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas')
63 return null; 63 return null;
64 const text = error.lastChild; 64 const text = error.lastChild;
65 if (text === condition)
66 return condition.localName;
65 if (text.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas' || text.localName !== 'text') 67 if (text.namespaceURI !== 'urn:ietf:params:xml:ns:xmpp-stanzas' || text.localName !== 'text')
66 return null; 68 return null;
67 return [condition.localName, text.textContent]; 69 return condition.localName + ': ' + text.textContent;
68 } 70 }
69 71
70 function displaySpinner(spinner) { 72 function displaySpinner(spinner) {
71 if ('timeoutid' in spinner.dataset) 73 if ('timeoutid' in spinner.dataset)
72 clearTimeout(spinner.dataset.timeoutid); 74 clearTimeout(spinner.dataset.timeoutid);