comparison libpurple/protocols/jabber/message.c @ 29915:097569720d68

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
author Paul Aurich <paul@darkrain42.org>
date Wed, 12 May 2010 05:21:19 +0000
parents 38926d6e5ae1
children 716d6bb38829
comparison
equal deleted inserted replaced
29914:a40c55113f7d 29915:097569720d68
1248 jb = jabber_buddy_find(gc->proto_data, who, TRUE); 1248 jb = jabber_buddy_find(gc->proto_data, who, TRUE);
1249 jbr = jabber_buddy_find_resource(jb, resource); 1249 jbr = jabber_buddy_find_resource(jb, resource);
1250 1250
1251 g_free(resource); 1251 g_free(resource);
1252 1252
1253 if (!jbr || (jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED)) 1253 /* We know this entity doesn't support chat states */
1254 if (jbr && jbr->chat_states == JABBER_CHAT_STATES_UNSUPPORTED)
1255 return 0;
1256
1257 /* *If* we don't have presence /and/ the buddy can't see our
1258 * presence, don't send typing notifications.
1259 */
1260 if (!jbr && !(jb->subscription & JABBER_SUB_FROM))
1254 return 0; 1261 return 0;
1255 1262
1256 /* TODO: figure out threading */ 1263 /* TODO: figure out threading */
1257 jm = g_new0(JabberMessage, 1); 1264 jm = g_new0(JabberMessage, 1);
1258 jm->js = gc->proto_data; 1265 jm->js = gc->proto_data;