annotate libpurple/protocols/jabber/google/jingleinfo.c @ 30530:2e26b90a28dd

Now it compiles again...
author Marcus Lundblad <ml@update.uu.se>
date Wed, 01 Sep 2010 21:23:55 +0000
parents 34f586bffe4e
children a8cc50c2279f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30473
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
1 /**
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
2 * Purple is the legal property of its developers, whose names are too numerous
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
3 * to list here. Please refer to the COPYRIGHT file distributed with this
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
4 * source distribution.
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
5 *
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
6 * This program is free software; you can redistribute it and/or modify
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
7 * it under the terms of the GNU General Public License as published by
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
8 * the Free Software Foundation; either version 2 of the License, or
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
9 * (at your option) any later version.
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
10 *
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
11 * This program is distributed in the hope that it will be useful,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
14 * GNU General Public License for more details.
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
15 *
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
16 * You should have received a copy of the GNU General Public License
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
17 * along with this program; if not, write to the Free Software
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
19 */
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
20
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
21 #include "internal.h"
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
22 #include "debug.h"
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
23 #include "jingleinfo.h"
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
24
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
25 static void
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
26 jabber_google_stun_lookup_cb(GSList *hosts, gpointer data,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
27 const char *error_message)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
28 {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
29 JabberStream *js = (JabberStream *) data;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
30
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
31 if (error_message) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
32 purple_debug_error("jabber", "Google STUN lookup failed: %s\n",
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
33 error_message);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
34 g_slist_free(hosts);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
35 js->stun_query = NULL;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
36 return;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
37 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
38
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
39 if (hosts && g_slist_next(hosts)) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
40 struct sockaddr *addr = g_slist_next(hosts)->data;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
41 char dst[INET6_ADDRSTRLEN];
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
42 int port;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
43
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
44 if (addr->sa_family == AF_INET6) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
45 inet_ntop(addr->sa_family, &((struct sockaddr_in6 *) addr)->sin6_addr,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
46 dst, sizeof(dst));
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
47 port = ntohs(((struct sockaddr_in6 *) addr)->sin6_port);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
48 } else {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
49 inet_ntop(addr->sa_family, &((struct sockaddr_in *) addr)->sin_addr,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
50 dst, sizeof(dst));
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
51 port = ntohs(((struct sockaddr_in *) addr)->sin_port);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
52 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
53
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
54 if (js->stun_ip)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
55 g_free(js->stun_ip);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
56 js->stun_ip = g_strdup(dst);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
57 js->stun_port = port;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
58
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
59 purple_debug_info("jabber", "set Google STUN IP/port address: "
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
60 "%s:%d\n", dst, port);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
61
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
62 /* unmark ongoing query */
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
63 js->stun_query = NULL;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
64 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
65
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
66 while (hosts != NULL) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
67 hosts = g_slist_delete_link(hosts, hosts);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
68 /* Free the address */
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
69 g_free(hosts->data);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
70 hosts = g_slist_delete_link(hosts, hosts);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
71 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
72 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
73
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
74 static void
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
75 jabber_google_jingle_info_common(JabberStream *js, const char *from,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
76 JabberIqType type, xmlnode *query)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
77 {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
78 const xmlnode *stun = xmlnode_get_child(query, "stun");
30530
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
79 const xmlnode *relay = xmlnode_get_child(query, "relay");
30473
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
80 gchar *my_bare_jid;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
81
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
82 /*
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
83 * Make sure that random people aren't sending us STUN servers. Per
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
84 * http://code.google.com/apis/talk/jep_extensions/jingleinfo.html, these
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
85 * stanzas are stamped from our bare JID.
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
86 */
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
87 if (from) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
88 my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
89 if (!purple_strequal(from, my_bare_jid)) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
90 purple_debug_warning("jabber", "got google:jingleinfo with invalid from (%s)\n",
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
91 from);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
92 g_free(my_bare_jid);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
93 return;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
94 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
95
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
96 g_free(my_bare_jid);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
97 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
98
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
99 if (type == JABBER_IQ_ERROR || type == JABBER_IQ_GET)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
100 return;
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
101
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
102 purple_debug_info("jabber", "got google:jingleinfo\n");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
103
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
104 if (stun) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
105 xmlnode *server = xmlnode_get_child(stun, "server");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
106
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
107 if (server) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
108 const gchar *host = xmlnode_get_attrib(server, "host");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
109 const gchar *udp = xmlnode_get_attrib(server, "udp");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
110
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
111 if (host && udp) {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
112 int port = atoi(udp);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
113 /* if there, would already be an ongoing query,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
114 cancel it */
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
115 if (js->stun_query)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
116 purple_dnsquery_destroy(js->stun_query);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
117
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
118 js->stun_query = purple_dnsquery_a(host, port,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
119 jabber_google_stun_lookup_cb, js);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
120 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
121 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
122 }
30530
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
123
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
124 if (relay) {
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
125 xmlnode *token = xmlnode_get_child(relay, "token");
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
126 xmlnode *server = xmlnode_get_child(relay, "server");
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
127
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
128 if (token) {
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
129 gchar *relay_token = xmlnode_get_data(token);
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
130
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
131 /* we let js own the string returned from xmlnode_get_data */
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
132 js->google_relay_token = relay_token;
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
133 }
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
134
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
135 if (server) {
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
136 js->google_relay_host =
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
137 g_strdup(xmlnode_get_attrib(server, "host"));
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
138 }
2e26b90a28dd Now it compiles again...
Marcus Lundblad <ml@update.uu.se>
parents: 30473
diff changeset
139 }
30473
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
140 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
141
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
142 static void
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
143 jabber_google_jingle_info_cb(JabberStream *js, const char *from,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
144 JabberIqType type, const char *id,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
145 xmlnode *packet, gpointer data)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
146 {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
147 xmlnode *query = xmlnode_get_child_with_namespace(packet, "query",
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
148 NS_GOOGLE_JINGLE_INFO);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
149
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
150 if (query)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
151 jabber_google_jingle_info_common(js, from, type, query);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
152 else
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
153 purple_debug_warning("jabber", "Got invalid google:jingleinfo\n");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
154 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
155
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
156 void
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
157 jabber_google_handle_jingle_info(JabberStream *js, const char *from,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
158 JabberIqType type, const char *id,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
159 xmlnode *child)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
160 {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
161 jabber_google_jingle_info_common(js, from, type, child);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
162 }
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
163
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
164 void
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
165 jabber_google_send_jingle_info(JabberStream *js)
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
166 {
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
167 JabberIq *jingle_info =
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
168 jabber_iq_new_query(js, JABBER_IQ_GET, NS_GOOGLE_JINGLE_INFO);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
169
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
170 jabber_iq_set_callback(jingle_info, jabber_google_jingle_info_cb,
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
171 NULL);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
172 purple_debug_info("jabber", "sending google:jingleinfo query\n");
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
173 jabber_iq_send(jingle_info);
34f586bffe4e Added new files in sub directory google
Marcus Lundblad <ml@update.uu.se>
parents:
diff changeset
174 }