I made some errors ;)

As I announced on Psi-devel mailinglist:

As a side effect of my SoC project, I improved stanza error handling in Psi (or rather Iris).

I did much work in Stanza::Error class. First of all, now it has fromXml()/toXml() members, so you can easily create error element:

QDomElement e = createIQ(client()->doc(), "error", jid, id);
Error error(Stanza::Error::Auth, Stanza::Error::NotAuthorized);
e.appendChild(error.toXml(*client()->doc(),
client()->stream().baseNS()));

Secondly, I added error mappings based on JEP-0086. This means that now Psi can read both old and new style errors (including error text, so no more empty “Reason: ” message boxes).
To make it more funny, if there is no error text at all, you can get default error description from RFC.

Other thing: some of error message boxes in psi have formatted text (”<b>”, etc), but had “\n” newlines, which don’t work in formatted mode. I changed them to “<br>”.

You can pull these changes from Darcs repository located at http://machekku.uaznia.net/darcs/psi/
Patches:
1. Improved stanza errors handling in Iris
2. Fixed formatted error message boxes

BTW: While testing my changes, I found a bug in Disco dialog.
To reproduce: try browsing a new server (like jabber.org) using Agents protocol. In old Psi, you’d see error message. In new Psi, you don’t get any message.

Leave a Reply