Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/buddy.c @ 29031:9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Fri, 27 Nov 2009 17:07:19 +0000 |
parents | ea818ffa22b6 |
children | bc1eb4dacd00 4ab6f0479bc5 |
comparison
equal
deleted
inserted
replaced
29030:8d8a1afc4268 | 29031:9ae3e70a327b |
---|---|
1464 { | 1464 { |
1465 /* can't be blacklisted if we don't know what you're running yet */ | 1465 /* can't be blacklisted if we don't know what you're running yet */ |
1466 if(!jbr->client.name) | 1466 if(!jbr->client.name) |
1467 return FALSE; | 1467 return FALSE; |
1468 | 1468 |
1469 if(!strcmp(ns, "jabber:iq:last")) { | 1469 if(!strcmp(ns, NS_LAST_ACTIVITY)) { |
1470 if(!strcmp(jbr->client.name, "Trillian")) { | 1470 if(!strcmp(jbr->client.name, "Trillian")) { |
1471 /* verified by nwalp 2007/05/09 */ | 1471 /* verified by nwalp 2007/05/09 */ |
1472 if(!strcmp(jbr->client.version, "3.1.0.121") || | 1472 if(!strcmp(jbr->client.version, "3.1.0.121") || |
1473 /* verified by nwalp 2007/09/19 */ | 1473 /* verified by nwalp 2007/09/19 */ |
1474 !strcmp(jbr->client.version, "3.1.7.0")) { | 1474 !strcmp(jbr->client.version, "3.1.7.0")) { |
1510 /* this is to fix the feeling of irritation I get when trying | 1510 /* this is to fix the feeling of irritation I get when trying |
1511 * to get info on a friend running Trillian, which doesn't | 1511 * to get info on a friend running Trillian, which doesn't |
1512 * respond (with an error or otherwise) to jabber:iq:last | 1512 * respond (with an error or otherwise) to jabber:iq:last |
1513 * requests. There are a number of Trillian users in my | 1513 * requests. There are a number of Trillian users in my |
1514 * office. */ | 1514 * office. */ |
1515 if(!_client_is_blacklisted(jbr, "jabber:iq:last")) { | 1515 if(!_client_is_blacklisted(jbr, NS_LAST_ACTIVITY)) { |
1516 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last"); | 1516 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_LAST_ACTIVITY); |
1517 xmlnode_set_attrib(iq->node, "to", to); | 1517 xmlnode_set_attrib(iq->node, "to", to); |
1518 jabber_iq_set_callback(iq, jabber_last_parse, jbi); | 1518 jabber_iq_set_callback(iq, jabber_last_parse, jbi); |
1519 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); | 1519 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); |
1520 jabber_iq_send(iq); | 1520 jabber_iq_send(iq); |
1521 } | 1521 } |
1522 | 1522 |
1523 if (jbr->tz_off == PURPLE_NO_TZ_OFF && | 1523 if (jbr->tz_off == PURPLE_NO_TZ_OFF && |
1524 (!jbr->caps.info || | 1524 (!jbr->caps.info || |
1525 jabber_resource_has_capability(jbr, "urn:xmpp:time"))) { | 1525 jabber_resource_has_capability(jbr, NS_ENTITY_TIME))) { |
1526 xmlnode *child; | 1526 xmlnode *child; |
1527 iq = jabber_iq_new(js, JABBER_IQ_GET); | 1527 iq = jabber_iq_new(js, JABBER_IQ_GET); |
1528 xmlnode_set_attrib(iq->node, "to", to); | 1528 xmlnode_set_attrib(iq->node, "to", to); |
1529 child = xmlnode_new_child(iq->node, "time"); | 1529 child = xmlnode_new_child(iq->node, "time"); |
1530 xmlnode_set_namespace(child, "urn:xmpp:time"); | 1530 xmlnode_set_namespace(child, NS_ENTITY_TIME); |
1531 jabber_iq_set_callback(iq, jabber_time_parse, jbi); | 1531 jabber_iq_set_callback(iq, jabber_time_parse, jbi); |
1532 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); | 1532 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); |
1533 jabber_iq_send(iq); | 1533 jabber_iq_send(iq); |
1534 } | 1534 } |
1535 | 1535 |
1588 "JabberBuddyResource!\n", jid); | 1588 "JabberBuddyResource!\n", jid); |
1589 } | 1589 } |
1590 | 1590 |
1591 if (!jb->resources && is_bare_jid) { | 1591 if (!jb->resources && is_bare_jid) { |
1592 /* user is offline, send a jabber:iq:last to find out last time online */ | 1592 /* user is offline, send a jabber:iq:last to find out last time online */ |
1593 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "jabber:iq:last"); | 1593 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_LAST_ACTIVITY); |
1594 xmlnode_set_attrib(iq->node, "to", jid); | 1594 xmlnode_set_attrib(iq->node, "to", jid); |
1595 jabber_iq_set_callback(iq, jabber_last_offline_parse, jbi); | 1595 jabber_iq_set_callback(iq, jabber_last_offline_parse, jbi); |
1596 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); | 1596 jbi->ids = g_slist_prepend(jbi->ids, g_strdup(iq->id)); |
1597 jabber_iq_send(iq); | 1597 jabber_iq_send(iq); |
1598 } | 1598 } |