Sun, 10 Apr 2011 19:21:27 +0000
jabber: Remember the last-used user directory. Closes #12451
Patch from Keith Moyer.
committer: Paul Aurich <darkrain42@pidgin.im>
|
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 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
25 | static void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
26 | jabber_google_stun_lookup_cb(GSList *hosts, gpointer data, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
27 | const char *error_message) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
28 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
29 | JabberStream *js = (JabberStream *) data; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
30 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
31 | if (error_message) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
32 | purple_debug_error("jabber", "Google STUN lookup failed: %s\n", |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
33 | error_message); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
34 | g_slist_free(hosts); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
35 | js->stun_query = NULL; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
36 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
37 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
38 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
39 | if (hosts && g_slist_next(hosts)) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
40 | struct sockaddr *addr = g_slist_next(hosts)->data; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
41 | char dst[INET6_ADDRSTRLEN]; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
42 | int port; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
43 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
44 | if (addr->sa_family == AF_INET6) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
45 | inet_ntop(addr->sa_family, &((struct sockaddr_in6 *) addr)->sin6_addr, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
46 | dst, sizeof(dst)); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
47 | port = ntohs(((struct sockaddr_in6 *) addr)->sin6_port); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
48 | } else { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
49 | inet_ntop(addr->sa_family, &((struct sockaddr_in *) addr)->sin_addr, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
50 | dst, sizeof(dst)); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
51 | port = ntohs(((struct sockaddr_in *) addr)->sin_port); |
|
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 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
54 | if (js->stun_ip) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
55 | g_free(js->stun_ip); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
56 | js->stun_ip = g_strdup(dst); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
57 | js->stun_port = port; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
58 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
59 | purple_debug_info("jabber", "set Google STUN IP/port address: " |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
60 | "%s:%d\n", dst, port); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
61 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
62 | /* unmark ongoing query */ |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
63 | js->stun_query = NULL; |
|
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 | while (hosts != NULL) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
67 | hosts = g_slist_delete_link(hosts, hosts); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
68 | /* Free the address */ |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
69 | g_free(hosts->data); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
70 | hosts = g_slist_delete_link(hosts, hosts); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
71 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
72 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
73 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
74 | static void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
75 | jabber_google_jingle_info_common(JabberStream *js, const char *from, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
76 | JabberIqType type, xmlnode *query) |
|
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 | const xmlnode *stun = xmlnode_get_child(query, "stun"); |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
79 | const xmlnode *relay = xmlnode_get_child(query, "relay"); |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
80 | gchar *my_bare_jid; |
|
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 | /* |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
83 | * Make sure that random people aren't sending us STUN servers. Per |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
84 | * http://code.google.com/apis/talk/jep_extensions/jingleinfo.html, these |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
85 | * stanzas are stamped from our bare JID. |
|
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 (from) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
88 | 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
|
89 | if (!purple_strequal(from, my_bare_jid)) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
90 | 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
|
91 | from); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
92 | g_free(my_bare_jid); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
93 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
94 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
95 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
96 | g_free(my_bare_jid); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
97 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
98 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
99 | 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
|
100 | return; |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
101 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
102 | purple_debug_info("jabber", "got google:jingleinfo\n"); |
|
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 | if (stun) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
105 | xmlnode *server = xmlnode_get_child(stun, "server"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
106 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
107 | if (server) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
108 | const gchar *host = xmlnode_get_attrib(server, "host"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
109 | const gchar *udp = xmlnode_get_attrib(server, "udp"); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
110 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
111 | if (host && udp) { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
112 | int port = atoi(udp); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
113 | /* if there, would already be an ongoing query, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
114 | cancel it */ |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
115 | if (js->stun_query) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
116 | purple_dnsquery_destroy(js->stun_query); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
117 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
118 | js->stun_query = purple_dnsquery_a(host, port, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
119 | jabber_google_stun_lookup_cb, js); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
120 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
121 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
122 | } |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
123 | |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
124 | if (relay) { |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
125 | xmlnode *token = xmlnode_get_child(relay, "token"); |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
126 | xmlnode *server = xmlnode_get_child(relay, "server"); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30771
diff
changeset
|
127 | |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
128 | if (token) { |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
129 | gchar *relay_token = xmlnode_get_data(token); |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
130 | |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
131 | /* we let js own the string returned from xmlnode_get_data */ |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
132 | js->google_relay_token = relay_token; |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
133 | } |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
134 | |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
135 | if (server) { |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
30771
diff
changeset
|
136 | js->google_relay_host = |
|
30771
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
137 | g_strdup(xmlnode_get_attrib(server, "host")); |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
138 | } |
|
66a23a6494bf
Now it compiles again...
Marcus Lundblad <malu@pidgin.im>
parents:
29914
diff
changeset
|
139 | } |
|
29914
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
140 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
141 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
142 | static void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
143 | 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
|
144 | JabberIqType type, const char *id, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
145 | xmlnode *packet, gpointer data) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
146 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
147 | xmlnode *query = xmlnode_get_child_with_namespace(packet, "query", |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
148 | NS_GOOGLE_JINGLE_INFO); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
149 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
150 | if (query) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
151 | 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
|
152 | else |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
153 | 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
|
154 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
155 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
156 | void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
157 | 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
|
158 | JabberIqType type, const char *id, |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
159 | xmlnode *child) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
160 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
161 | 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
|
162 | } |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
163 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
164 | void |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
165 | jabber_google_send_jingle_info(JabberStream *js) |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
166 | { |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
167 | JabberIq *jingle_info = |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
168 | 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
|
169 | |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
170 | 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
|
171 | NULL); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
172 | 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
|
173 | jabber_iq_send(jingle_info); |
|
a4ed5999f6d0
Added new files in sub directory google
Marcus Lundblad <malu@pidgin.im>
parents:
diff
changeset
|
174 | } |