Fri, 18 Dec 2015 18:26:12 -0600
This should do it for XMPP
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
1 | /** |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
2 | * Purple is the legal property of its developers, whose names are too numerous |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
3 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
4 | * source distribution. |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
5 | * |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
6 | * This program is free software; you can redistribute it and/or modify |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
7 | * it under the terms of the GNU General Public License as published by |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
8 | * the Free Software Foundation; either version 2 of the License, or |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
9 | * (at your option) any later version. |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
10 | * |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
11 | * This program is distributed in the hope that it will be useful, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
14 | * GNU General Public License for more details. |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
15 | * |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
16 | * You should have received a copy of the GNU General Public License |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
17 | * along with this program; if not, write to the Free Software |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
19 | */ |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
20 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
21 | #include "internal.h" |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
22 | #include "debug.h" |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
23 | #include "jingleinfo.h" |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
24 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
25 | #include <gio/gio.h> |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
26 | |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
27 | static void |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
28 | jabber_google_stun_lookup_cb(GObject *sender, GAsyncResult *result, gpointer data) { |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
29 | GError *error = NULL; |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
30 | GList *addresses = NULL; |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
31 | JabberStream *js = (JabberStream *) data; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
32 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
33 | addresses = g_resolver_lookup_by_name_finish(g_resolver_get_default(), result, &error); |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
34 | |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
35 | if(error) { |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
36 | purple_debug_error("jabber", "Google STUN lookup failed: %s\n", |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
37 | error->message); |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
38 | |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
39 | g_error_free(error); |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
40 | |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
41 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
42 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
43 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
44 | if(g_list_length(addresses) > 0) { |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
45 | GInetAddress *inet_address = G_INET_ADDRESS(addresses->data); |
|
35676
d9fdd45925ec
Fix some of invalid alignment warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34935
diff
changeset
|
46 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
47 | g_free(js->stun_ip); |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
48 | js->stun_ip = g_inet_address_to_string(inet_address); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
49 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
50 | purple_debug_info("jabber", "set Google STUN IP/port address: " |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
51 | "%s:%d\n", js->stun_ip, js->stun_port); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
52 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
53 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
54 | g_resolver_free_addresses(addresses); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
55 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
56 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
57 | static void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
58 | jabber_google_jingle_info_common(JabberStream *js, const char *from, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
59 | JabberIqType type, PurpleXmlNode *query) |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
60 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
61 | const PurpleXmlNode *stun = purple_xmlnode_get_child(query, "stun"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
62 | const PurpleXmlNode *relay = purple_xmlnode_get_child(query, "relay"); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
63 | gchar *my_bare_jid; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
64 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
65 | /* |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
66 | * Make sure that random people aren't sending us STUN servers. Per |
|
33956
84f5fef32685
Fix and/or canonicalize a few URLs.
Mark Doliner <mark@kingant.net>
parents:
32297
diff
changeset
|
67 | * https://developers.google.com/talk/jep_extensions/jingleinfo, these |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
68 | * stanzas are stamped from our bare JID. |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
69 | */ |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
70 | if (from) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
71 | my_bare_jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
72 | if (!purple_strequal(from, my_bare_jid)) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
73 | purple_debug_warning("jabber", "got google:jingleinfo with invalid from (%s)\n", |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
74 | from); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
75 | g_free(my_bare_jid); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
76 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
77 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
78 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
79 | g_free(my_bare_jid); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
80 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
81 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
82 | if (type == JABBER_IQ_ERROR || type == JABBER_IQ_GET) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
83 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
84 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
85 | purple_debug_info("jabber", "got google:jingleinfo\n"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
86 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
87 | if (stun) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
88 | PurpleXmlNode *server = purple_xmlnode_get_child(stun, "server"); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
89 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
90 | if (server) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
91 | const gchar *host = purple_xmlnode_get_attrib(server, "host"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
92 | const gchar *udp = purple_xmlnode_get_attrib(server, "udp"); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
93 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
94 | if (host && udp) { |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
95 | js->stun_port = atoi(udp); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
96 | |
|
37457
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
97 | g_resolver_lookup_by_name_async(g_resolver_get_default(), |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
98 | host, |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
99 | NULL, |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
100 | jabber_google_stun_lookup_cb, |
|
0b957b80c46a
This should do it for XMPP
Gary Kramlich <grim@reaperworld.com>
parents:
35676
diff
changeset
|
101 | js); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
102 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
103 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
104 | } |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
105 | |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
106 | if (relay) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
107 | PurpleXmlNode *token = purple_xmlnode_get_child(relay, "token"); |
|
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
108 | PurpleXmlNode *server = purple_xmlnode_get_child(relay, "server"); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30771
diff
changeset
|
109 | |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
110 | if (token) { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
111 | gchar *relay_token = purple_xmlnode_get_data(token); |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
112 | |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
113 | /* we let js own the string returned from purple_xmlnode_get_data */ |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
114 | js->google_relay_token = relay_token; |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
115 | } |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
116 | |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
117 | if (server) { |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30771
diff
changeset
|
118 | js->google_relay_host = |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
119 | g_strdup(purple_xmlnode_get_attrib(server, "host")); |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
120 | } |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
121 | } |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
122 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
123 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
124 | static void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
125 | jabber_google_jingle_info_cb(JabberStream *js, const char *from, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
126 | JabberIqType type, const char *id, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
127 | PurpleXmlNode *packet, gpointer data) |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
128 | { |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
129 | PurpleXmlNode *query = purple_xmlnode_get_child_with_namespace(packet, "query", |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
130 | NS_GOOGLE_JINGLE_INFO); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
131 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
132 | if (query) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
133 | jabber_google_jingle_info_common(js, from, type, query); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
134 | else |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
135 | purple_debug_warning("jabber", "Got invalid google:jingleinfo\n"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
136 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
137 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
138 | void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
139 | jabber_google_handle_jingle_info(JabberStream *js, const char *from, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
140 | JabberIqType type, const char *id, |
|
34935
686fa55b0deb
Replaced xmlnode with PurpleXmlNode, and xmlnode_* API with purple_xmlnode_* API
Ankit Vani <a@nevitus.org>
parents:
33956
diff
changeset
|
141 | PurpleXmlNode *child) |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
142 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
143 | jabber_google_jingle_info_common(js, from, type, child); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
144 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
145 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
146 | void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
147 | jabber_google_send_jingle_info(JabberStream *js) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
148 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
149 | JabberIq *jingle_info = |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
150 | jabber_iq_new_query(js, JABBER_IQ_GET, NS_GOOGLE_JINGLE_INFO); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
151 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
152 | jabber_iq_set_callback(jingle_info, jabber_google_jingle_info_cb, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
153 | NULL); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
154 | purple_debug_info("jabber", "sending google:jingleinfo query\n"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
155 | jabber_iq_send(jingle_info); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
156 | } |