pidgin: b721192f: jabber: Send typing notifications to a b...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed May 12 01:25:29 EDT 2010


-----------------------------------------------------------------
Revision: b721192f0b7c409b2f6d8829fc79087ee7587bfb
Ancestor: 884d44222e8c81ecec51c25e07d005e002a5479b
Author: darkrain42 at pidgin.im
Date: 2010-05-12T05:21:19
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b721192f0b7c409b2f6d8829fc79087ee7587bfb

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

ChangeLog: 

jabber: Send typing notifications to a buddy when it can see our presence

This allows us to send typing notifications to a resource which we haven't
seen presence from (because there's a product out there that coalesces
presence to bare JID, but exposes resources for messaging, which I think
is stupid).  Should Fixes #11819

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	45f326602cc59e0d49b684a346eee745c510196d
+++ libpurple/protocols/jabber/message.c	9dd323516e1f9fa98e668fe61297216c3f24cb82
@@ -1250,9 +1250,16 @@ unsigned int jabber_send_typing(PurpleCo
 
 	g_free(resource);
 
-	if (!jbr || (jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED))
+	/* We know this entity doesn't support chat states */
+	if (jbr && jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED)
 		return 0;
 
+	/* *If* we don't have presence /and/ the buddy can't see our
+	 * presence, don't send typing notifications.
+	 */
+	if (!jbr && !(jb->subscription & JABBER_SUB_FROM))
+		return 0;
+
 	/* TODO: figure out threading */
 	jm = g_new0(JabberMessage, 1);
 	jm->js = gc->proto_data;


More information about the Commits mailing list