pidgin: 2b685799: jabber: Fix typing notifications between...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Aug 22 14:36:27 EDT 2009


-----------------------------------------------------------------
Revision: 2b68579960365fea9a55bc39baf90eb59c42f972
Ancestor: 5f0bd751206378b9557654c6a6286407c7e48e35
Author: darkrain42 at pidgin.im
Date: 2009-08-22T18:29:44
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2b68579960365fea9a55bc39baf90eb59c42f972

Modified files:
        ChangeLog libpurple/protocols/jabber/message.c
        libpurple/protocols/jabber/presence.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- ChangeLog	c55bd8e642eddbaff27bea35917737a7c44071d8
+++ ChangeLog	2376c6f8c1093a035f1f73b5b6670b122aeac977
@@ -10,6 +10,7 @@ version 2.6.2 (??/??/2009):
 	* 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)
============================================================
--- libpurple/protocols/jabber/message.c	6ca308df42791dd29e8df6e61048e0948ecd41c8
+++ libpurple/protocols/jabber/message.c	21cd394353687a7b01d5a2eb49e7df666c146b63
@@ -89,8 +89,12 @@ static void handle_chat(JabberMessage *j
 	}
 
 	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);
============================================================
--- libpurple/protocols/jabber/presence.c	151f1dde420ca50c742332a37760baaefe05959a
+++ libpurple/protocols/jabber/presence.c	3d1271b2947410a7c76e1aecb1990f8381293437
@@ -471,10 +471,17 @@ jabber_presence_set_capabilities(JabberC
 		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);


More information about the Commits mailing list