Should track multiple addresses with link-local XMPP, and try all of them
Bug description
When using link-local XMPP with Avahi, the last discovered address wins. This is a 50:50 chance of breakage if the other host really is only reachable via IPv4, but we keep an IPv6 address only. (Or the other way round.) This is relevant with old gajim (0.15.1) which (on Debian 7) only listens on IPv4, but registers with Avahi for any protocol, including IPv6 (for which it does not listen). 0.15.1 seems to have other problems with link-local messaging which are fixed in 0.16.1 according to the changelog, but with fixing current gajim, we can at least send a message to 0.15.1, though it can't relieably reply.
I've tried to fix the code to store multiple addresses, and try to connect to other addresses on connect error, see attached files. These 4 commits still require review / more testing, but it should be a start.
Steps to reproduce
Start a Gajim 0.15.1 on a remote Debian 7 host with IPv6 dual-stack. Let it connect to Local. Start a current/hg Gajim (0.16.1+) on your own dual-stack host. Try to message the remote host via link-local XMPP. With a 50:50 chance it will use the remote host's IPv6 address, on which the 0.15.1 Gajim does not listen, so the message will not arrive. (See gajim -v debug output for which address for the remote side was discovered last.)
Software versions
OS version: Debian 7 'wheezy'
GTK version: 2.24.10
PyGTK version: 2.24.0