Sat, 21 Mar 2009 09:07:06 +0000
Clean up usage of USE_VV in the XMPP protocol.
| 7014 | 1 | /* |
| 15884 | 2 | * purple - Jabber Protocol Plugin |
| 7014 | 3 | * |
| 4 | * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18443
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 7014 | 19 | * |
| 20 | */ | |
| 21 | #include "internal.h" | |
|
18441
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
22 | #include "core.h" |
| 7014 | 23 | #include "debug.h" |
| 24 | #include "prefs.h" | |
| 10941 | 25 | #include "util.h" |
| 7014 | 26 | |
| 7395 | 27 | #include "buddy.h" |
| 8312 | 28 | #include "disco.h" |
| 15225 | 29 | #include "google.h" |
| 7014 | 30 | #include "iq.h" |
|
26143
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
23754
diff
changeset
|
31 | #include "jingle/jingle.h" |
| 7170 | 32 | #include "oob.h" |
| 7014 | 33 | #include "roster.h" |
| 7395 | 34 | #include "si.h" |
|
17769
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
35 | #include "ping.h" |
|
17805
5bd417a1c847
Implemented XEP-0050: Ad-Hoc Commands. Note that this XEP requires sending an initial command to the peer, which is not implemented in libpurple itself (since this requires a discovery browser or equivalent).
Andreas Monitzer <am@adiumx.com>
parents:
17769
diff
changeset
|
36 | #include "adhoccommands.h" |
|
23626
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
37 | #include "data.h" |
|
24372
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
38 | #include "ibb.h" |
| 7014 | 39 | |
|
7058
c62db98b7a2a
[gaim-migrate @ 7621]
Herman Bloggs <herman@bluedigits.com>
parents:
7014
diff
changeset
|
40 | #ifdef _WIN32 |
|
c62db98b7a2a
[gaim-migrate @ 7621]
Herman Bloggs <herman@bluedigits.com>
parents:
7014
diff
changeset
|
41 | #include "utsname.h" |
|
c62db98b7a2a
[gaim-migrate @ 7621]
Herman Bloggs <herman@bluedigits.com>
parents:
7014
diff
changeset
|
42 | #endif |
| 7014 | 43 | |
| 14356 | 44 | GHashTable *iq_handlers = NULL; |
| 45 | ||
| 46 | ||
| 7014 | 47 | JabberIq *jabber_iq_new(JabberStream *js, JabberIqType type) |
| 48 | { | |
| 49 | JabberIq *iq; | |
| 50 | ||
| 51 | iq = g_new0(JabberIq, 1); | |
| 52 | ||
| 53 | iq->type = type; | |
| 54 | ||
| 55 | iq->node = xmlnode_new("iq"); | |
| 56 | switch(iq->type) { | |
| 57 | case JABBER_IQ_SET: | |
| 58 | xmlnode_set_attrib(iq->node, "type", "set"); | |
| 59 | break; | |
| 60 | case JABBER_IQ_GET: | |
| 61 | xmlnode_set_attrib(iq->node, "type", "get"); | |
| 62 | break; | |
| 63 | case JABBER_IQ_ERROR: | |
| 64 | xmlnode_set_attrib(iq->node, "type", "error"); | |
| 65 | break; | |
| 66 | case JABBER_IQ_RESULT: | |
| 67 | xmlnode_set_attrib(iq->node, "type", "result"); | |
| 68 | break; | |
| 69 | case JABBER_IQ_NONE: | |
| 70 | /* this shouldn't ever happen */ | |
| 71 | break; | |
| 72 | } | |
| 73 | ||
| 74 | iq->js = js; | |
| 75 | ||
| 76 | if(type == JABBER_IQ_GET || type == JABBER_IQ_SET) { | |
| 77 | iq->id = jabber_get_next_id(js); | |
| 78 | xmlnode_set_attrib(iq->node, "id", iq->id); | |
| 79 | } | |
| 80 | ||
| 81 | return iq; | |
| 82 | } | |
| 83 | ||
| 84 | JabberIq *jabber_iq_new_query(JabberStream *js, JabberIqType type, | |
| 85 | const char *xmlns) | |
| 86 | { | |
| 87 | JabberIq *iq = jabber_iq_new(js, type); | |
| 88 | xmlnode *query; | |
| 89 | ||
| 90 | query = xmlnode_new_child(iq->node, "query"); | |
| 13808 | 91 | xmlnode_set_namespace(query, xmlns); |
| 7014 | 92 | |
| 93 | return iq; | |
| 94 | } | |
| 95 | ||
| 7395 | 96 | typedef struct _JabberCallbackData { |
| 97 | JabberIqCallback *callback; | |
| 98 | gpointer data; | |
| 99 | } JabberCallbackData; | |
| 100 | ||
| 101 | void | |
| 102 | jabber_iq_set_callback(JabberIq *iq, JabberIqCallback *callback, gpointer data) | |
| 7014 | 103 | { |
| 104 | iq->callback = callback; | |
| 7395 | 105 | iq->callback_data = data; |
| 7014 | 106 | } |
| 107 | ||
| 108 | void jabber_iq_set_id(JabberIq *iq, const char *id) | |
| 109 | { | |
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
110 | g_free(iq->id); |
| 7014 | 111 | |
| 112 | if(id) { | |
| 113 | xmlnode_set_attrib(iq->node, "id", id); | |
| 114 | iq->id = g_strdup(id); | |
| 115 | } else { | |
| 116 | xmlnode_remove_attrib(iq->node, "id"); | |
| 117 | iq->id = NULL; | |
| 118 | } | |
| 119 | } | |
| 120 | ||
| 121 | void jabber_iq_send(JabberIq *iq) | |
| 122 | { | |
| 7395 | 123 | JabberCallbackData *jcd; |
| 7014 | 124 | g_return_if_fail(iq != NULL); |
| 125 | ||
| 126 | jabber_send(iq->js, iq->node); | |
| 127 | ||
| 7395 | 128 | if(iq->id && iq->callback) { |
| 129 | jcd = g_new0(JabberCallbackData, 1); | |
| 130 | jcd->callback = iq->callback; | |
| 131 | jcd->data = iq->callback_data; | |
| 8312 | 132 | g_hash_table_insert(iq->js->iq_callbacks, g_strdup(iq->id), jcd); |
| 7395 | 133 | } |
| 7014 | 134 | |
| 135 | jabber_iq_free(iq); | |
| 136 | } | |
| 137 | ||
| 138 | void jabber_iq_free(JabberIq *iq) | |
| 139 | { | |
| 140 | g_return_if_fail(iq != NULL); | |
| 141 | ||
| 142 | g_free(iq->id); | |
| 143 | xmlnode_free(iq->node); | |
| 144 | g_free(iq); | |
| 145 | } | |
| 146 | ||
| 8312 | 147 | static void jabber_iq_last_parse(JabberStream *js, xmlnode *packet) |
| 7014 | 148 | { |
| 149 | JabberIq *iq; | |
| 8006 | 150 | const char *type; |
| 7014 | 151 | const char *from; |
| 152 | const char *id; | |
| 153 | xmlnode *query; | |
|
14453
1cc75906700c
[gaim-migrate @ 17098]
Mark Doliner <markdoliner@pidgin.im>
parents:
14375
diff
changeset
|
154 | char *idle_time; |
| 7014 | 155 | |
| 8006 | 156 | type = xmlnode_get_attrib(packet, "type"); |
| 7014 | 157 | from = xmlnode_get_attrib(packet, "from"); |
| 158 | id = xmlnode_get_attrib(packet, "id"); | |
| 159 | ||
| 8006 | 160 | if(type && !strcmp(type, "get")) { |
| 161 | iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "jabber:iq:last"); | |
| 162 | jabber_iq_set_id(iq, id); | |
| 163 | xmlnode_set_attrib(iq->node, "to", from); | |
| 7014 | 164 | |
| 8006 | 165 | query = xmlnode_get_child(iq->node, "query"); |
| 7014 | 166 | |
|
14453
1cc75906700c
[gaim-migrate @ 17098]
Mark Doliner <markdoliner@pidgin.im>
parents:
14375
diff
changeset
|
167 | idle_time = g_strdup_printf("%ld", js->idle ? time(NULL) - js->idle : 0); |
|
1cc75906700c
[gaim-migrate @ 17098]
Mark Doliner <markdoliner@pidgin.im>
parents:
14375
diff
changeset
|
168 | xmlnode_set_attrib(query, "seconds", idle_time); |
|
1cc75906700c
[gaim-migrate @ 17098]
Mark Doliner <markdoliner@pidgin.im>
parents:
14375
diff
changeset
|
169 | g_free(idle_time); |
| 7401 | 170 | |
| 8006 | 171 | jabber_iq_send(iq); |
| 172 | } | |
| 7014 | 173 | } |
| 174 | ||
| 8312 | 175 | static void jabber_iq_time_parse(JabberStream *js, xmlnode *packet) |
| 7014 | 176 | { |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
177 | const char *type, *from, *id, *xmlns; |
| 7014 | 178 | JabberIq *iq; |
| 179 | xmlnode *query; | |
| 180 | time_t now_t; | |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
8315
diff
changeset
|
181 | struct tm *now; |
|
9722
c1072806bcae
[gaim-migrate @ 10583]
Mark Doliner <markdoliner@pidgin.im>
parents:
9709
diff
changeset
|
182 | |
| 7014 | 183 | time(&now_t); |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
8315
diff
changeset
|
184 | now = localtime(&now_t); |
| 7014 | 185 | |
| 8006 | 186 | type = xmlnode_get_attrib(packet, "type"); |
| 7014 | 187 | from = xmlnode_get_attrib(packet, "from"); |
| 188 | id = xmlnode_get_attrib(packet, "id"); | |
| 189 | ||
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
190 | /* we're gonna throw this away in a moment, but we need it |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
191 | * to get the xmlns, so we can figure out if this is |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
192 | * jabber:iq:time or urn:xmpp:time */ |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
193 | query = xmlnode_get_child(packet, "query"); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
194 | xmlns = xmlnode_get_namespace(query); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
195 | |
| 8006 | 196 | if(type && !strcmp(type, "get")) { |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
197 | xmlnode *utc; |
|
13105
8f9c66e4af87
[gaim-migrate @ 15466]
Richard Laager <rlaager@pidgin.im>
parents:
12284
diff
changeset
|
198 | const char *date; |
| 7014 | 199 | |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
200 | iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, xmlns); |
| 8006 | 201 | jabber_iq_set_id(iq, id); |
| 202 | xmlnode_set_attrib(iq->node, "to", from); | |
| 203 | ||
| 204 | query = xmlnode_get_child(iq->node, "query"); | |
| 7014 | 205 | |
| 15884 | 206 | date = purple_utf8_strftime("%Y%m%dT%T", now); |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
207 | utc = xmlnode_new_child(query, "utc"); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
208 | xmlnode_insert_data(utc, date, -1); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
209 | |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
210 | if(!strcmp("urn:xmpp:time", xmlns)) { |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
211 | xmlnode_insert_data(utc, "Z", 1); /* of COURSE the thing that is the same is different */ |
| 10941 | 212 | |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
213 | date = purple_get_tzoff_str(now, TRUE); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
214 | xmlnode_insert_data(xmlnode_new_child(query, "tzo"), date, -1); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
215 | } else { /* jabber:iq:time */ |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
216 | date = purple_utf8_strftime("%Z", now); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
217 | xmlnode_insert_data(xmlnode_new_child(query, "tz"), date, -1); |
| 10941 | 218 | |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
219 | date = purple_utf8_strftime("%d %b %Y %T", now); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
220 | xmlnode_insert_data(xmlnode_new_child(query, "display"), date, -1); |
|
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
221 | } |
| 7014 | 222 | |
| 8006 | 223 | jabber_iq_send(iq); |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
224 | } |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
225 | } |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
226 | |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
227 | static void urn_xmpp_ping_parse(JabberStream *js, xmlnode *packet) |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
228 | { |
|
18194
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
229 | const char *type, *id, *from; |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
230 | JabberIq *iq; |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
231 | |
|
18194
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
232 | type = xmlnode_get_attrib(packet, "type"); |
|
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
233 | from = xmlnode_get_attrib(packet, "from"); |
|
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
234 | id = xmlnode_get_attrib(packet, "id"); |
|
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
235 | |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
236 | if(type && !strcmp(type, "get")) { |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
237 | iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "urn:xmpp:ping"); |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
238 | |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
239 | jabber_iq_set_id(iq, id); |
|
18194
5365792ac81f
i'm an idiot. now we have real support for replying to XMPP pings
Nathan Walp <nwalp@pidgin.im>
parents:
18184
diff
changeset
|
240 | xmlnode_set_attrib(iq->node, "to", from); |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
241 | |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
242 | jabber_iq_send(iq); |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
243 | } else { |
|
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
244 | /* XXX: error */ |
| 8006 | 245 | } |
| 7014 | 246 | } |
| 247 | ||
| 8312 | 248 | static void jabber_iq_version_parse(JabberStream *js, xmlnode *packet) |
| 7014 | 249 | { |
| 250 | JabberIq *iq; | |
| 8006 | 251 | const char *type, *from, *id; |
| 7014 | 252 | xmlnode *query; |
| 253 | ||
| 8006 | 254 | type = xmlnode_get_attrib(packet, "type"); |
| 255 | ||
| 256 | if(type && !strcmp(type, "get")) { | |
|
18441
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
257 | GHashTable *ui_info; |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
258 | const char *ui_name = NULL, *ui_version = NULL; |
|
20116
9952c317df4c
applied changes from 8543caa9958f323a231c630bebd65c74dec3401f
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
259 | #if 0 |
|
20225
684334efdc19
applied changes from d4b316d73ebaf93803ca2642e78b8821c3b5d5c7
Luke Schierer <lschiere@pidgin.im>
parents:
20116
diff
changeset
|
260 | char *os = NULL; |
| 15884 | 261 | if(!purple_prefs_get_bool("/plugins/prpl/jabber/hide_os")) { |
| 8006 | 262 | struct utsname osinfo; |
| 7014 | 263 | |
| 8006 | 264 | uname(&osinfo); |
| 265 | os = g_strdup_printf("%s %s %s", osinfo.sysname, osinfo.release, | |
| 266 | osinfo.machine); | |
| 267 | } | |
|
20116
9952c317df4c
applied changes from 8543caa9958f323a231c630bebd65c74dec3401f
Richard Laager <rlaager@pidgin.im>
parents:
19897
diff
changeset
|
268 | #endif |
| 8006 | 269 | from = xmlnode_get_attrib(packet, "from"); |
| 270 | id = xmlnode_get_attrib(packet, "id"); | |
| 7014 | 271 | |
| 8006 | 272 | iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, "jabber:iq:version"); |
| 273 | xmlnode_set_attrib(iq->node, "to", from); | |
| 274 | jabber_iq_set_id(iq, id); | |
| 7014 | 275 | |
| 8006 | 276 | query = xmlnode_get_child(iq->node, "query"); |
| 7014 | 277 | |
|
18441
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
278 | ui_info = purple_core_get_ui_info(); |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
279 | |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
280 | if(NULL != ui_info) { |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
281 | ui_name = g_hash_table_lookup(ui_info, "name"); |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
282 | ui_version = g_hash_table_lookup(ui_info, "version"); |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
283 | } |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
284 | |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
285 | if(NULL != ui_name && NULL != ui_version) { |
| 18443 | 286 | char *version_complete = g_strdup_printf("%s (libpurple " VERSION ")", ui_version); |
| 287 | xmlnode_insert_data(xmlnode_new_child(query, "name"), ui_name, -1); | |
| 288 | xmlnode_insert_data(xmlnode_new_child(query, "version"), version_complete, -1); | |
| 289 | g_free(version_complete); | |
|
18441
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
290 | } else { |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
291 | xmlnode_insert_data(xmlnode_new_child(query, "name"), "libpurple", -1); |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
292 | xmlnode_insert_data(xmlnode_new_child(query, "version"), VERSION, -1); |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
293 | } |
|
d255d04c0aa1
core support for UI info...now to do the UI piece
Nathan Walp <nwalp@pidgin.im>
parents:
18317
diff
changeset
|
294 | |
|
20225
684334efdc19
applied changes from d4b316d73ebaf93803ca2642e78b8821c3b5d5c7
Luke Schierer <lschiere@pidgin.im>
parents:
20116
diff
changeset
|
295 | #if 0 |
| 8006 | 296 | if(os) { |
| 297 | xmlnode_insert_data(xmlnode_new_child(query, "os"), os, -1); | |
| 298 | g_free(os); | |
| 299 | } | |
|
20225
684334efdc19
applied changes from d4b316d73ebaf93803ca2642e78b8821c3b5d5c7
Luke Schierer <lschiere@pidgin.im>
parents:
20116
diff
changeset
|
300 | #endif |
| 10941 | 301 | |
| 8006 | 302 | jabber_iq_send(iq); |
| 7014 | 303 | } |
| 304 | } | |
| 305 | ||
| 13794 | 306 | void jabber_iq_remove_callback_by_id(JabberStream *js, const char *id) |
| 307 | { | |
| 308 | g_hash_table_remove(js->iq_callbacks, id); | |
| 309 | } | |
| 310 | ||
| 7014 | 311 | void jabber_iq_parse(JabberStream *js, xmlnode *packet) |
| 312 | { | |
| 7395 | 313 | JabberCallbackData *jcd; |
| 8169 | 314 | xmlnode *query, *error, *x; |
| 7014 | 315 | const char *xmlns; |
| 8135 | 316 | const char *type, *id, *from; |
| 14356 | 317 | JabberIqHandler *jih; |
| 7014 | 318 | |
| 319 | query = xmlnode_get_child(packet, "query"); | |
| 8043 | 320 | type = xmlnode_get_attrib(packet, "type"); |
| 8135 | 321 | from = xmlnode_get_attrib(packet, "from"); |
| 8312 | 322 | id = xmlnode_get_attrib(packet, "id"); |
| 323 | ||
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
324 | if(type == NULL || !(!strcmp(type, "get") || !strcmp(type, "set") |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
325 | || !strcmp(type, "result") || !strcmp(type, "error"))) { |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
326 | purple_debug_error("jabber", "IQ with invalid type ('%s') - ignoring.\n", |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
327 | type ? type : "(null)"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
328 | return; |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
329 | } |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
330 | |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
331 | /* All IQs must have an ID, so send an error for a set/get that doesn't */ |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
332 | if(!id || !*id) { |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
333 | |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
334 | if(!strcmp(type, "set") || !strcmp(type, "get")) { |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
335 | JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
336 | |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
337 | xmlnode_free(iq->node); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
338 | iq->node = xmlnode_copy(packet); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
339 | xmlnode_set_attrib(iq->node, "to", from); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
340 | xmlnode_remove_attrib(iq->node, "from"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
341 | xmlnode_set_attrib(iq->node, "type", "error"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
342 | /* This id is clearly not useful, but we must put something there for a valid stanza */ |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
343 | iq->id = jabber_get_next_id(js); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
344 | xmlnode_set_attrib(iq->node, "id", iq->id); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
345 | error = xmlnode_new_child(iq->node, "error"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
346 | xmlnode_set_attrib(error, "type", "modify"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
347 | x = xmlnode_new_child(error, "bad-request"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
348 | xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
349 | |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
350 | jabber_iq_send(iq); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
351 | } else |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
352 | purple_debug_error("jabber", "IQ of type '%s' missing id - ignoring.\n", type); |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
353 | |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
354 | return; |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
355 | } |
|
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
356 | |
| 8312 | 357 | /* First, lets see if a special callback got registered */ |
| 358 | ||
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
359 | if(!strcmp(type, "result") || !strcmp(type, "error")) { |
| 8312 | 360 | if(id && *id && (jcd = g_hash_table_lookup(js->iq_callbacks, id))) { |
| 361 | jcd->callback(js, packet, jcd->data); | |
| 13794 | 362 | jabber_iq_remove_callback_by_id(js, id); |
| 8314 | 363 | return; |
| 8312 | 364 | } |
| 365 | } | |
| 366 | ||
| 367 | /* Apparently not, so lets see if we have a pre-defined handler */ | |
| 7014 | 368 | |
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
369 | if(query && (xmlns = xmlnode_get_namespace(query))) { |
| 14356 | 370 | if((jih = g_hash_table_lookup(iq_handlers, xmlns))) { |
| 371 | jih(js, packet); | |
| 8262 | 372 | return; |
| 373 | } | |
| 7395 | 374 | } |
|
26454
94130b583e0b
Clean up usage of USE_VV in the XMPP protocol.
Michael Ruprecht <maiku@pidgin.im>
parents:
26337
diff
changeset
|
375 | |
|
94130b583e0b
Clean up usage of USE_VV in the XMPP protocol.
Michael Ruprecht <maiku@pidgin.im>
parents:
26337
diff
changeset
|
376 | #ifdef USE_VV |
|
19882
d8c2a2fc1fbf
Basic Google Talk voice call support. No UI; receiving a call auto-accepts it.
Sean Egan <seanegan@pidgin.im>
parents:
18443
diff
changeset
|
377 | if (xmlnode_get_child_with_namespace(packet, "session", "http://www.google.com/session")) { |
|
d8c2a2fc1fbf
Basic Google Talk voice call support. No UI; receiving a call auto-accepts it.
Sean Egan <seanegan@pidgin.im>
parents:
18443
diff
changeset
|
378 | jabber_google_session_parse(js, packet); |
|
d8c2a2fc1fbf
Basic Google Talk voice call support. No UI; receiving a call auto-accepts it.
Sean Egan <seanegan@pidgin.im>
parents:
18443
diff
changeset
|
379 | return; |
|
d8c2a2fc1fbf
Basic Google Talk voice call support. No UI; receiving a call auto-accepts it.
Sean Egan <seanegan@pidgin.im>
parents:
18443
diff
changeset
|
380 | } |
|
26454
94130b583e0b
Clean up usage of USE_VV in the XMPP protocol.
Michael Ruprecht <maiku@pidgin.im>
parents:
26337
diff
changeset
|
381 | #endif |
| 7395 | 382 | |
| 14356 | 383 | if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { |
| 384 | jabber_si_parse(js, packet); | |
| 385 | return; | |
| 386 | } | |
| 387 | ||
| 15225 | 388 | if(xmlnode_get_child_with_namespace(packet, "new-mail", "google:mail:notify")) { |
| 389 | jabber_gmail_poke(js, packet); | |
| 390 | return; | |
| 391 | } | |
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
392 | |
|
17769
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
393 | purple_debug_info("jabber", "jabber_iq_parse\n"); |
|
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
394 | |
|
18911
34ae89bfee24
Updated the XEP-0199 namespace according to the XEP.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
395 | if(xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) { |
|
17769
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
396 | jabber_ping_parse(js, packet); |
|
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
397 | return; |
|
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
15884
diff
changeset
|
398 | } |
| 15225 | 399 | |
|
24254
2d990726bf92
Updated to use latest spec. in XEP-0231
Marcus Lundblad <malu@pidgin.im>
parents:
23626
diff
changeset
|
400 | if (xmlnode_get_child_with_namespace(packet, "data", XEP_0231_NAMESPACE)) { |
|
23626
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
401 | jabber_data_parse(js, packet); |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
402 | return; |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
403 | } |
|
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
404 | |
|
24372
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
405 | if (xmlnode_get_child_with_namespace(packet, "data", XEP_0047_NAMESPACE) |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
406 | || xmlnode_get_child_with_namespace(packet, "close", XEP_0047_NAMESPACE) |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
407 | || xmlnode_get_child_with_namespace(packet, "open", XEP_0047_NAMESPACE)) { |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
408 | jabber_ibb_parse(js, packet); |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
409 | return; |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
410 | } |
|
26454
94130b583e0b
Clean up usage of USE_VV in the XMPP protocol.
Michael Ruprecht <maiku@pidgin.im>
parents:
26337
diff
changeset
|
411 | |
|
26143
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
23754
diff
changeset
|
412 | if (xmlnode_get_child_with_namespace(packet, "jingle", JINGLE)) { |
|
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
23754
diff
changeset
|
413 | jingle_parse(js, packet); |
|
23747
86aacf5be74e
Further decouple Jingle from iq.c
Michael Ruprecht <maiku@pidgin.im>
parents:
23720
diff
changeset
|
414 | return; |
|
22648
e286d795c5f9
Patch from Marcus Lundblad ('mlundblad') to improve audio support in xmpp.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22069
diff
changeset
|
415 | } |
|
23626
e21afec2f485
Custom smileys for XMPP according to XEP 0231. Refs #5627.
Marcus Lundblad <malu@pidgin.im>
parents:
23076
diff
changeset
|
416 | |
| 8312 | 417 | /* If we get here, send the default error reply mandated by XMPP-CORE */ |
|
24520
726138a1c69b
Perform some sanity checking on inbound IQs and send an error / drop as needed.
Daniel Atallah <datallah@pidgin.im>
parents:
24254
diff
changeset
|
418 | if(!strcmp(type, "set") || !strcmp(type, "get")) { |
| 8315 | 419 | JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); |
| 8135 | 420 | |
| 8315 | 421 | xmlnode_free(iq->node); |
| 422 | iq->node = xmlnode_copy(packet); | |
| 423 | xmlnode_set_attrib(iq->node, "to", from); | |
|
11825
fe23dc05a8a6
[gaim-migrate @ 14116]
Mark Doliner <markdoliner@pidgin.im>
parents:
11822
diff
changeset
|
424 | xmlnode_remove_attrib(iq->node, "from"); |
| 8315 | 425 | xmlnode_set_attrib(iq->node, "type", "error"); |
| 426 | error = xmlnode_new_child(iq->node, "error"); | |
| 427 | xmlnode_set_attrib(error, "type", "cancel"); | |
| 428 | xmlnode_set_attrib(error, "code", "501"); | |
| 429 | x = xmlnode_new_child(error, "feature-not-implemented"); | |
| 13808 | 430 | xmlnode_set_namespace(x, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
| 8169 | 431 | |
| 8315 | 432 | jabber_iq_send(iq); |
| 433 | } | |
| 7014 | 434 | } |
| 435 | ||
|
23076
e415fa270dfe
Fix jabber_iq_register_handler() to match header.
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
436 | void jabber_iq_register_handler(const char *xmlns, JabberIqHandler *handlerfunc) |
| 14356 | 437 | { |
| 438 | g_hash_table_replace(iq_handlers, g_strdup(xmlns), handlerfunc); | |
| 439 | } | |
| 440 | ||
| 441 | void jabber_iq_init(void) | |
| 442 | { | |
| 443 | iq_handlers = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); | |
| 444 | ||
| 445 | jabber_iq_register_handler("jabber:iq:roster", jabber_roster_parse); | |
| 446 | jabber_iq_register_handler("jabber:iq:oob", jabber_oob_parse); | |
| 447 | jabber_iq_register_handler("http://jabber.org/protocol/bytestreams", jabber_bytestreams_parse); | |
| 448 | jabber_iq_register_handler("jabber:iq:last", jabber_iq_last_parse); | |
| 449 | jabber_iq_register_handler("jabber:iq:time", jabber_iq_time_parse); | |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18194
diff
changeset
|
450 | jabber_iq_register_handler("urn:xmpp:time", jabber_iq_time_parse); |
| 14356 | 451 | jabber_iq_register_handler("jabber:iq:version", jabber_iq_version_parse); |
| 452 | jabber_iq_register_handler("http://jabber.org/protocol/disco#info", jabber_disco_info_parse); | |
| 453 | jabber_iq_register_handler("http://jabber.org/protocol/disco#items", jabber_disco_items_parse); | |
| 454 | jabber_iq_register_handler("jabber:iq:register", jabber_register_parse); | |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17753
diff
changeset
|
455 | jabber_iq_register_handler("urn:xmpp:ping", urn_xmpp_ping_parse); |
|
26143
673b6665624d
Restructure Jingle code to more easily support multiple application types.
Michael Ruprecht <maiku@pidgin.im>
parents:
23754
diff
changeset
|
456 | jabber_iq_register_handler(JINGLE, jingle_parse); |
|
26454
94130b583e0b
Clean up usage of USE_VV in the XMPP protocol.
Michael Ruprecht <maiku@pidgin.im>
parents:
26337
diff
changeset
|
457 | |
|
26286
443041606e32
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <malu@pidgin.im>
parents:
26152
diff
changeset
|
458 | /* handle Google jingleinfo */ |
|
443041606e32
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <malu@pidgin.im>
parents:
26152
diff
changeset
|
459 | jabber_iq_register_handler(GOOGLE_JINGLE_INFO_NAMESPACE, |
|
443041606e32
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <malu@pidgin.im>
parents:
26152
diff
changeset
|
460 | jabber_google_handle_jingle_info); |
| 14356 | 461 | } |
| 462 | ||
| 463 | void jabber_iq_uninit(void) | |
| 464 | { | |
| 465 | g_hash_table_destroy(iq_handlers); | |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
20225
diff
changeset
|
466 | iq_handlers = NULL; |
| 14356 | 467 | } |
| 468 |