Fix #258: V&V call gets rejected when IPv6 is enabled (III)

With commit 23b1c820a5dfdb3475c0da21edadedf669a11298 the original fix
became a no-op. Partially revert it.
mingw: improve crash information reporting

Up to now we have always released libsipe.dll without stripping it. But
Pidgin crash reporter expects files with debug symbols at a special
location.

Update the MinGW build to also generate & install a stripped
libsipe.dll, just like Pidgin Windows does.

Update the NSIS installer to copy the stripped libsipe.dll to the usual
place and the non-stripped libsipe.dll.dbgsym into the same location
where Pidgin expects files with debug symbols.

The Pidgin.RPT file should now contain more information when SIPE causes
a crash.

(cherry picked from commit 528db6a9b4015f6653c4b6681f43d764b8bbc8a3)
Fix #257: Windows 7: SIPE crashes after a minute

When trying to simulate the same situation, i.e. all EWS autodiscover
attempts fail with a DNS error, I noticed a slight difference between my
debug logs and the debug logs provided by the reporters.

I can only explain this difference if g_hash_table_remove() calls the
value destroy callback *before* removing the hash table entry. In our
case the destroy callback triggers the EWS HTTP callback which
immediately generates another HTTP request. In one situation that new
HTTP request has the same host:port key as the just "removed" entry and
the SIPE HTTP stack tries to re-establish the connection which is
actually already invalid.

Circumvent this race condition by using g_hash_table_steal() and calling
the value destroy callback by hand.

(cherry picked from commit 3893f9589a0440d89f0c9519f5b46b2e6d947a37)
Fix #257: Windows 7: SIPE crashes after a minute (II)

I verified from the GLIB version history that before 2.30.0 destroy
notifiers were called before the hash table entry was invalidated. In
SIPE HTTP stack this can lead to race conditions.

Updated the code accordingly.

(cherry picked from commit 6ff1bcfab046d82f70a1309b6ed4c7ccd6f167a9)
Fix #259: HTML response to EWS autodiscover triggers libxml2 assert

Add "Accept: text/xml" header to EWS POST request to reject all other
content types in response.

(cherry picked from commit 1bb58b5b481ba39992c40ed3cef9e93bfd8e4a3b)
Fix #259: HTML response to EWS autodiscover triggers libxml2 assert (II)

It seems that some HTTP servers ignore the "Accept:" header. Added a
check that the "Content-Type:" header starts with "text/xml" before we
call the libxml2 parser.

NOTE: I couldn't reproduce the libxml2 assert on Fedora 20 from the
provided debug log. It simply complains about XML errors and returns
a parse error to the caller.

(cherry picked from commit 6061788181cc9b971aca289b37a2a37e508ce22f)
Fix #258: V&V call gets rejected when IPv6 is enabled

commit 1556f377ecc7c3d4887f8e9f2805a4e7f7e60660 changed the candidates
list to be sorted when it is created and *NOT* sort it when it is
converted to the SDP message. Unfortunately that changed the value of
msg->ip in sipe_media_to_sdpmsg() [through backend_stream_to_sdpmedia()
and backend_candidates_to_sdpcandidate()] in the case when an IPv6
address was assigned to the host.

As the media code does not support IPv6 addresses yet, we now reject IP
address strings with ":" in get_stream_ip_and_ports().

(cherry picked from commit 396613000a879625c5a836a3b5f71b8f3e20fd0a)
OBS: sync with latest versions

(cherry picked from commit b690205588cdbcea47fd441bf267e7944c37bfd2)
media: ignore IPv6 candidates
(cherry picked from commit 23b1c820a5dfdb3475c0da21edadedf669a11298)
Fix #258: V&V call gets rejected when IPv6 is enabled (III)

With commit 23b1c820a5dfdb3475c0da21edadedf669a11298 the original fix
became a no-op. Partially revert it.

(cherry picked from commit 22e2659c2f490cfe5bdf6dd604c160fe69a69f57)
Release 1.18.3 -- Bug Fixes III
Merge tag '1.18.3' into mob

Release 1.18.3 -- Bug Fixes III

Conflicts:
	ChangeLog
	contrib/opensuse-build-service/pidgin-sipe.changes
	siplcs.vcxproj
purple: fix memory leak in set buddy status

Reported in this forum thread

  https://sourceforge.net/p/sipe/discussion/688534/thread/4aca1c0a/
transport: fix potential memory leak when signing message

Another leak reported in this forum thread

  https://sourceforge.net/p/sipe/discussion/688534/thread/4aca1c0a/

NOTE: I could not reproduce it so this fix is just a guess.
Fix #262: Adium: SIPE doesn't auto- or re-connect

If server auto-discovery is in use then the plugin doesn't have a value
for KEY_CONNECT_HOST. We used to set it to the localized name returned
by NSHost. But that isn't necessarily a valid DNS hostname and therefore
Adium's reachability test fails for the SIPE account.

Now we hard-code the value to "localhost" instead. During my tests this
was the only value that always worked.
Fix #262: Adium: SIPE doesn't auto- or re-connec (II)

If server auto-discovery is in use then use the well known host
"adium.im" instead of "localhost". This prevents the SIPE account from
going online when there is no network.

NOTE: this will mean that SIPE will not auto-connect for users that are
      on an Intranet-only setup, because they will not be able to reach
      the host adium.im on the Internet.