pidgin: 90256b41: jabber: Refined logic for determining "i...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed May 12 02:40:55 EDT 2010


-----------------------------------------------------------------
Revision: 90256b412e775f65ca4a2204654f8f6012dd2c47
Ancestor: 46e26786ecd3bebc04997a2701f8382d76cd958e
Author: darkrain42 at pidgin.im
Date: 2010-05-12T06:35:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/90256b412e775f65ca4a2204654f8f6012dd2c47

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

ChangeLog: 

jabber: Refined logic for determining "is typing" support.

This was pointed out by the people in #11819 as being slightly better
(ignore stray <message/> stanzas and no way to "escape")

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	9dd323516e1f9fa98e668fe61297216c3f24cb82
+++ libpurple/protocols/jabber/message.c	01bd63d3f9d470888095e5c4bfe40307f3ef761e
@@ -75,12 +75,8 @@ static void handle_chat(JabberMessage *j
 	jbr = jabber_buddy_find_resource(jb, jid->resource);
 
 	if(!jm->xhtml && !jm->body) {
-		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 (jbr && jm->chat_state != JM_STATE_NONE)
+			jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
 
 		if(JM_STATE_COMPOSING == jm->chat_state) {
 			serv_got_typing(gc, jm->from, 0, PURPLE_TYPING);
@@ -142,10 +138,13 @@ static void handle_chat(JabberMessage *j
 		}
 
 		if(jbr) {
-			if (jm->chat_state != JM_STATE_NONE)
-				jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
-			else
-				jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+			/* Treat SUPPORTED as a terminal with no escape :) */
+			if (jbr->chat_states != JABBER_CHAT_STATES_SUPPORTED) {
+				if (jm->chat_state != JM_STATE_NONE)
+					jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED;
+				else
+					jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED;
+			}
 
 			if(jbr->thread_id)
 				g_free(jbr->thread_id);


More information about the Commits mailing list