diff options
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index ccf9d3d30..6b737e70b 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -569,8 +569,16 @@ static struct aji_resource *aji_find_resource(struct aji_buddy *buddy, char *nam static int gtalk_yuck(iks *node) { if (iks_find_with_attrib(node, "c", "node", "http://www.google.com/xmpp/client/caps")) { + ast_debug(1, "Found resource with Googletalk voice capabilities\n"); + return 1; + } else if (iks_find_with_attrib(node, "caps:c", "ext", "pmuc-v1 sms-v1 camera-v1 video-v1 voice-v1")) { + ast_debug(1, "Found resource with Gmail voice/video chat capabilities\n"); + return 1; + } else if (iks_find_with_attrib(node, "caps:c", "ext", "pmuc-v1 sms-v1 video-v1 voice-v1")) { + ast_debug(1, "Found resource with Gmail voice/video chat capabilities (no camera)\n"); return 1; } + return 0; } @@ -1577,6 +1585,23 @@ static int aji_act_hook(void *data, int type, iks *node) pak = iks_packet(node); + /* work around iksemel's impossibility to recognize node names + * containing a semicolon. Set the namespace of the corresponding + * node accordingly. */ + if (iks_has_children(node) && strchr(iks_name(iks_child(node)), ':')) { + char *node_ns = NULL; + char attr[AJI_MAX_ATTRLEN]; + char *node_name = iks_name(iks_child(node)); + char *aux = strchr(node_name, ':') + 1; + snprintf(attr, strlen("xmlns:") + (strlen(node_name) - strlen(aux)), "xmlns:%s", node_name); + node_ns = iks_find_attrib(iks_child(node), attr); + if (node_ns) { + pak->ns = node_ns; + pak->query = iks_child(node); + } + } + + if (!client->component) { /*client */ switch (type) { case IKS_NODE_START: @@ -2405,7 +2430,7 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) if (gtalk_yuck(pak->x)) { /* gtalk should do discover */ found->cap->jingle = 1; } - if (found->cap->jingle && option_debug > 4) { + if (found->cap->jingle) { ast_debug(1, "Special case for google till they support discover.\n"); } else { iks *iq, *query; |