changeset 28060:faf98a4b27d8

jabber: Fix typing notifications between 2.6.0 and <= 2.5.9. If the Pidgin 2.6.0 user initiates a conversation, there will be no typing notifications, as Pidgin <2.6.0 *has* entity capabilities but does not advertise the Chat States feature (...ugh...). Closes #9996. This also fixes Adium#12643.
author Paul Aurich <paul@darkrain42.org>
date Sat, 22 Aug 2009 18:29:44 +0000
parents f6cdf5f72479
children 7115d04c525a
files ChangeLog libpurple/protocols/jabber/message.c libpurple/protocols/jabber/presence.c
diffstat 3 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Aug 22 06:20:10 2009 +0000
+++ b/ChangeLog	Sat Aug 22 18:29:44 2009 +0000
@@ -10,6 +10,7 @@
 	* Escape status messages that have HTML entities in the Get Info dialog.
 	* Fix connecting to XMPP domains with no SRV records from Pidgin on
 	  Windows.
+	* Fix typing notifications with Pidgin 2.5.9 or earlier.
 
 	Finch:
 	* Properly detect libpanel on OpenBSD.  (Brad Smith)
--- a/libpurple/protocols/jabber/message.c	Sat Aug 22 06:20:10 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Sat Aug 22 18:29:44 2009 +0000
@@ -89,8 +89,12 @@
 	}
 
 	if(!jm->xhtml && !jm->body) {
-		if (jbr)
-			jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+		if (jbr) {
+			if (jm->chat_state != JM_STATE_NONE)
+				jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+			else
+				jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+		}
 
 		if(JM_STATE_COMPOSING == jm->chat_state) {
 			serv_got_typing(jm->js->gc, from, 0, PURPLE_TYPING);
--- a/libpurple/protocols/jabber/presence.c	Sat Aug 22 06:20:10 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Sat Aug 22 18:29:44 2009 +0000
@@ -471,10 +471,17 @@
 		jbr->commands_fetched = TRUE;
 	}
 
+#if 0
+	/*
+	 * Versions of libpurple before 2.6.0 didn't advertise this capability, so
+	 * we can't yet use Entity Capabilities to determine whether or not the
+	 * other client supports Entity Capabilities.
+	 */
 	if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/chatstates"))
 		jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
 	else
 		jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+#endif
 
 out:
 	g_free(userdata->from);