Mercurial > pidgin.yaz
annotate libpurple/protocols/jabber/disco.c @ 28867:d6cc51c4e375
Removed a couple of stray whitespaces...
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Tue, 03 Nov 2009 19:02:32 +0000 |
parents | fc8c85e8b6e1 |
children | 7b4ade7c6d8a |
rev | line source |
---|---|
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
1 /* |
26329
f5e613e05332
Applied disco-2.patch from nops with some modifications:
Paul Aurich <paul@darkrain42.org>
parents:
25443
diff
changeset
|
2 * purple - Jabber Service Discovery |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
3 * |
28398
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
28259
diff
changeset
|
4 * Purple is the legal property of its developers, whose names are too numerous |
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
28259
diff
changeset
|
5 * to list here. Please refer to the COPYRIGHT file distributed with this |
c585572e80dd
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <paul@darkrain42.org>
parents:
28259
diff
changeset
|
6 * source distribution. |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
7 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
8 * This program is free software; you can redistribute it and/or modify |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
11 * (at your option) any later version. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
12 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
17 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU General Public License |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
19 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19653
diff
changeset
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
21 * |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
22 */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
23 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
24 #include "internal.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
25 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "debug.h" |
27053 | 27 #include "request.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
28 |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
29 #include "adhoccommands.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
30 #include "buddy.h" |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
31 #include "disco.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
32 #include "google.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "iq.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "jabber.h" |
26014
bd598b606ca4
Restructure Jingle code to more easily support multiple application types.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25718
diff
changeset
|
35 #include "jingle/jingle.h" |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
36 #include "pep.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
37 #include "presence.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "roster.h" |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
39 #include "useravatar.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
40 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 struct _jabber_disco_info_cb_data { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 JabberDiscoInfoCallback *callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 |
26340
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
46 struct _jabber_disco_items_cb_data { |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
47 gpointer data; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
48 JabberDiscoItemsCallback *callback; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
49 }; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
50 |
17576
e49b259fc7dd
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <pidgin@monitzer.com>
parents:
17566
diff
changeset
|
51 #define SUPPORT_FEATURE(x) { \ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
52 feature = xmlnode_new_child(query, "feature"); \ |
17576
e49b259fc7dd
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <pidgin@monitzer.com>
parents:
17566
diff
changeset
|
53 xmlnode_set_attrib(feature, "var", x); \ |
e49b259fc7dd
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <pidgin@monitzer.com>
parents:
17566
diff
changeset
|
54 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
55 |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
56 static void |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
57 jabber_disco_bytestream_server_cb(JabberStream *js, const char *from, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
58 JabberIqType type, const char *id, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
59 xmlnode *packet, gpointer data) |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
60 { |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
61 JabberBytestreamsStreamhost *sh = data; |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
62 xmlnode *query = xmlnode_get_child_with_namespace(packet, "query", |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
63 "http://jabber.org/protocol/bytestreams"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
64 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
65 if (from && !strcmp(from, sh->jid) && query != NULL) { |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
66 xmlnode *sh_node = xmlnode_get_child(query, "streamhost"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
67 if (sh_node) { |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
68 const char *jid = xmlnode_get_attrib(sh_node, "jid"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
69 const char *port = xmlnode_get_attrib(sh_node, "port"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
70 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
71 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
72 if (jid == NULL || strcmp(jid, from) != 0) |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
73 purple_debug_error("jabber", "Invalid jid(%s) for bytestream.\n", |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
74 jid ? jid : "(null)"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
75 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
76 sh->host = g_strdup(xmlnode_get_attrib(sh_node, "host")); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
77 sh->zeroconf = g_strdup(xmlnode_get_attrib(sh_node, "zeroconf")); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
78 if (port != NULL) |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
79 sh->port = atoi(port); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
80 } |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
81 } |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
82 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
83 purple_debug_info("jabber", "Discovered bytestream proxy server: " |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
84 "jid='%s' host='%s' port='%d' zeroconf='%s'\n", |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
85 from ? from : "", sh->host ? sh->host : "", |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
86 sh->port, sh->zeroconf ? sh->zeroconf : ""); |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
87 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
88 /* TODO: When we support zeroconf proxies, fix this to handle them */ |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
89 if (!(sh->jid && sh->host && sh->port > 0)) { |
28138
deecc1d663c4
Don't use pointers (even opaquely) once they're freed. Closes #9822.
Paul Aurich <paul@darkrain42.org>
parents:
28113
diff
changeset
|
90 js->bs_proxies = g_list_remove(js->bs_proxies, sh); |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
91 g_free(sh->jid); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
92 g_free(sh->host); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
93 g_free(sh->zeroconf); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
94 g_free(sh); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
95 } |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
96 } |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
97 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
98 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
99 void jabber_disco_info_parse(JabberStream *js, const char *from, |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
100 JabberIqType type, const char *id, |
26569
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
101 xmlnode *in_query) |
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
102 { |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
103 if(type == JABBER_IQ_GET) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
104 xmlnode *query, *identity, *feature; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 JabberIq *iq; |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
106 const char *node = xmlnode_get_attrib(in_query, "node"); |
26569
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
107 char *node_uri = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
108 |
25760
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
109 /* create custom caps node URI */ |
25742
4040da08a733
Entity Capabilities must be per-JabberStream
Paul Aurich <paul@darkrain42.org>
parents:
25741
diff
changeset
|
110 node_uri = g_strconcat(CAPS0115_NODE, "#", jabber_caps_get_own_hash(js), NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
111 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
112 iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
113 "http://jabber.org/protocol/disco#info"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
114 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
115 jabber_iq_set_id(iq, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
116 |
28113
cbbde19ce02d
jabber: disco#info queries with no 'from' are from the server; valid.
Paul Aurich <paul@darkrain42.org>
parents:
28079
diff
changeset
|
117 if (from) |
cbbde19ce02d
jabber: disco#info queries with no 'from' are from the server; valid.
Paul Aurich <paul@darkrain42.org>
parents:
28079
diff
changeset
|
118 xmlnode_set_attrib(iq->node, "to", from); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
119 query = xmlnode_get_child(iq->node, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
120 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
121 if(node) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
122 xmlnode_set_attrib(query, "node", node); |
26434
e23a74d7c97c
Get rid of the rest of the extraneous changes.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26213
diff
changeset
|
123 |
27136
dd7e7071d46d
Whitespace + a change cluttering up the diff with im.pidgin.pidgin
Paul Aurich <paul@darkrain42.org>
parents:
27135
diff
changeset
|
124 if(!node || g_str_equal(node, node_uri)) { |
25741
1225f3dcf5ab
Fix compilation errors and many warnings
Paul Aurich <paul@darkrain42.org>
parents:
25716
diff
changeset
|
125 GList *features, *identities; |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
126 for(identities = jabber_identities; identities; identities = identities->next) { |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
127 JabberIdentity *ident = (JabberIdentity*)identities->data; |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
128 identity = xmlnode_new_child(query, "identity"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
129 xmlnode_set_attrib(identity, "category", ident->category); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
130 xmlnode_set_attrib(identity, "type", ident->type); |
25760
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
131 if (ident->lang) |
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
132 xmlnode_set_attrib(identity, "xml:lang", ident->lang); |
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
133 if (ident->name) |
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
134 xmlnode_set_attrib(identity, "name", ident->name); |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
135 } |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
136 for(features = jabber_features; features; features = features->next) { |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
137 JabberFeature *feat = (JabberFeature*)features->data; |
25760
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
138 if (!feat->is_enabled || feat->is_enabled(js, feat->namespace)) { |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
139 feature = xmlnode_new_child(query, "feature"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
140 xmlnode_set_attrib(feature, "var", feat->namespace); |
19489
b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <pidgin@monitzer.com>
parents:
18685
diff
changeset
|
141 } |
b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <pidgin@monitzer.com>
parents:
18685
diff
changeset
|
142 } |
25664
d0ac3c438b71
Check remote JID's capabilities for audio and video XEP support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25637
diff
changeset
|
143 #ifdef USE_VV |
26539
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
144 } else if (g_str_equal(node, CAPS0115_NODE "#" "voice-v1")) { |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
145 /* |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
146 * HUGE HACK! We advertise this ext (see jabber_presence_create_js |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
147 * where we add <c/> to the <presence/>) for the Google Talk |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
148 * clients that don't actually check disco#info features. |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
149 * |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
150 * This specific feature is redundant but is what |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
151 * node='http://mail.google.com/xmpp/client/caps', ver='1.1' |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
152 * advertises as 'voice-v1'. |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
153 */ |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
154 xmlnode *feature = xmlnode_new_child(query, "feature"); |
20743d9bd62d
Fix allowing gmail user to initiate voice call by advertising a specific ext
Paul Aurich <paul@darkrain42.org>
parents:
26529
diff
changeset
|
155 xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/voice/v1"); |
27079
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
156 } else if (g_str_equal(node, CAPS0115_NODE "#" "video-v1")) { |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
157 /* |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
158 * HUGE HACK! We advertise this ext (see jabber_presence_create_js |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
159 * where we add <c/> to the <presence/>) for the Google Talk |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
160 * clients that don't actually check disco#info features. |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
161 * |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
162 * This specific feature is redundant but is what |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
163 * node='http://mail.google.com/xmpp/client/caps', ver='1.1' |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
164 * advertises as 'video-v1'. |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
165 */ |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
166 xmlnode *feature = xmlnode_new_child(query, "feature"); |
72bcdcb0629f
Add Gmail video support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26849
diff
changeset
|
167 xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/video/v1"); |
28079
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
168 } else if (g_str_equal(node, CAPS0115_NODE "#" "camera-v1")) { |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
169 /* |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
170 * HUGE HACK! We advertise this ext (see jabber_presence_create_js |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
171 * where we add <c/> to the <presence/>) for the Google Talk |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
172 * clients that don't actually check disco#info features. |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
173 * |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
174 * This specific feature is redundant but is what |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
175 * node='http://mail.google.com/xmpp/client/caps', ver='1.1' |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
176 * advertises as 'camera-v1'. |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
177 */ |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
178 xmlnode *feature = xmlnode_new_child(query, "feature"); |
49cb3fc2c01a
Add the camera-v1 cap or else Gmail refuses to accept we're video enabled.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
27616
diff
changeset
|
179 xmlnode_set_attrib(feature, "var", "http://www.google.com/xmpp/protocol/camera/v1"); |
25664
d0ac3c438b71
Check remote JID's capabilities for audio and video XEP support.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
25637
diff
changeset
|
180 #endif |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
181 } else { |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
182 xmlnode *error, *inf; |
27052
413006df9828
propagate from branch 'im.pidgin.pidgin' (head 13ac492a493b4d31c8b29905174b43a533304300)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
183 |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
184 /* XXX: gross hack, implement jabber_iq_set_type or something */ |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
185 xmlnode_set_attrib(iq->node, "type", "error"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
186 iq->type = JABBER_IQ_ERROR; |
25443
5f9a24d1c25e
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25253
diff
changeset
|
187 |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
188 error = xmlnode_new_child(query, "error"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
189 xmlnode_set_attrib(error, "code", "404"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
190 xmlnode_set_attrib(error, "type", "cancel"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
191 inf = xmlnode_new_child(error, "item-not-found"); |
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
192 xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
193 } |
25575
26eabe8e739b
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
21603
diff
changeset
|
194 g_free(node_uri); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
195 jabber_iq_send(iq); |
26680
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
196 } else if (type == JABBER_IQ_SET) { |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
197 /* wtf? seriously. wtf‽ */ |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
198 JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
199 xmlnode *error, *bad_request; |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
200 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
201 /* Free the <query/> */ |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
202 xmlnode_free(xmlnode_get_child(iq->node, "query")); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
203 /* Add an error */ |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
204 error = xmlnode_new_child(iq->node, "error"); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
205 xmlnode_set_attrib(error, "type", "modify"); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
206 bad_request = xmlnode_new_child(error, "bad-request"); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
207 xmlnode_set_namespace(bad_request, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
208 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
209 jabber_iq_set_id(iq, id); |
28113
cbbde19ce02d
jabber: disco#info queries with no 'from' are from the server; valid.
Paul Aurich <paul@darkrain42.org>
parents:
28079
diff
changeset
|
210 if (from) |
cbbde19ce02d
jabber: disco#info queries with no 'from' are from the server; valid.
Paul Aurich <paul@darkrain42.org>
parents:
28079
diff
changeset
|
211 xmlnode_set_attrib(iq->node, "to", from); |
26680
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
212 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
213 jabber_iq_send(iq); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
214 } |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
215 } |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
216 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
217 static void jabber_disco_info_cb(JabberStream *js, const char *from, |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
218 JabberIqType type, const char *id, |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
219 xmlnode *packet, gpointer data) |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
220 { |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
221 struct _jabber_disco_info_cb_data *jdicd = data; |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
222 xmlnode *query; |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
223 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
224 query = xmlnode_get_child_with_namespace(packet, "query", |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
225 "http://jabber.org/protocol/disco#info"); |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
226 |
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
227 if (type == JABBER_IQ_RESULT && query) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 xmlnode *child; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 JabberCapabilities capabilities = JABBER_CAP_NONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 if((jid = jabber_id_new(from))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
235 if(jid->resource && (jb = jabber_buddy_find(js, from, TRUE))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
236 jbr = jabber_buddy_find_resource(jb, jid->resource); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
238 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
239 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 capabilities = jbr->capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
242 |
26680
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
243 for(child = query->child; child; child = child->next) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 if(child->type != XMLNODE_TYPE_TAG) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 if(!strcmp(child->name, "identity")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
248 const char *category = xmlnode_get_attrib(child, "category"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
249 const char *type = xmlnode_get_attrib(child, "type"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 if(!category || !type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 if(!strcmp(category, "conference") && !strcmp(type, "text")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
254 /* we found a groupchat or MUC server, add it to the list */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
255 /* XXX: actually check for protocol/muc or gc-1.0 support */ |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
256 js->chat_servers = g_list_prepend(js->chat_servers, g_strdup(from)); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
257 } else if(!strcmp(category, "directory") && !strcmp(type, "user")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
258 /* we found a JUD */ |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
259 js->user_directories = g_list_prepend(js->user_directories, g_strdup(from)); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
260 } else if(!strcmp(category, "proxy") && !strcmp(type, "bytestreams")) { |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
261 /* This is a bytestream proxy */ |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
262 JabberIq *iq; |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
263 JabberBytestreamsStreamhost *sh; |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
264 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
265 purple_debug_info("jabber", "Found bytestream proxy server: %s\n", from); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
266 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
267 sh = g_new0(JabberBytestreamsStreamhost, 1); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
268 sh->jid = g_strdup(from); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
269 js->bs_proxies = g_list_prepend(js->bs_proxies, sh); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
270 |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
271 iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
272 "http://jabber.org/protocol/bytestreams"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
273 xmlnode_set_attrib(iq->node, "to", sh->jid); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
274 jabber_iq_set_callback(iq, jabber_disco_bytestream_server_cb, sh); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
275 jabber_iq_send(iq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
276 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
277 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 } else if(!strcmp(child->name, "feature")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
279 const char *var = xmlnode_get_attrib(child, "var"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 if(!var) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
283 if(!strcmp(var, "http://jabber.org/protocol/si")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 capabilities |= JABBER_CAP_SI; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
285 else if(!strcmp(var, "http://jabber.org/protocol/si/profile/file-transfer")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
286 capabilities |= JABBER_CAP_SI_FILE_XFER; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 else if(!strcmp(var, "http://jabber.org/protocol/bytestreams")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 capabilities |= JABBER_CAP_BYTESTREAMS; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 else if(!strcmp(var, "jabber:iq:search")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 capabilities |= JABBER_CAP_IQ_SEARCH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 else if(!strcmp(var, "jabber:iq:register")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
292 capabilities |= JABBER_CAP_IQ_REGISTER; |
26548
cde07a2e4531
Do not advertise support for old XEP-0199 (Ping) namespace
Paul Aurich <paul@darkrain42.org>
parents:
26547
diff
changeset
|
293 else if(!strcmp(var, "urn:xmpp:ping")) |
17562
6ab1089e2101
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <pidgin@monitzer.com>
parents:
17561
diff
changeset
|
294 capabilities |= JABBER_CAP_PING; |
26329
f5e613e05332
Applied disco-2.patch from nops with some modifications:
Paul Aurich <paul@darkrain42.org>
parents:
25443
diff
changeset
|
295 else if(!strcmp(var, "http://jabber.org/protocol/disco#items")) |
f5e613e05332
Applied disco-2.patch from nops with some modifications:
Paul Aurich <paul@darkrain42.org>
parents:
25443
diff
changeset
|
296 capabilities |= JABBER_CAP_ITEMS; |
17609
f88b3a093cba
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17576
diff
changeset
|
297 else if(!strcmp(var, "http://jabber.org/protocol/commands")) { |
f88b3a093cba
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17576
diff
changeset
|
298 capabilities |= JABBER_CAP_ADHOC; |
f88b3a093cba
Implemented ad-hoc commands for the buddy action menu (untested), implemented the receiving end of XEP-0115: Entity Capabilities. Note that this seems not to be reliable right now, since some clients seem to have a very broken [read: completely non-functional] implementation (most notably Gajim and the py-transports).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17576
diff
changeset
|
299 } |
23999
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
300 else if(!strcmp(var, "http://jabber.org/protocol/ibb")) { |
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
301 purple_debug_info("jabber", "remote supports IBB\n"); |
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
302 capabilities |= JABBER_CAP_IBB; |
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
303 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
304 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
305 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
306 |
28259
2b9da4c0c47b
Reverse the list of conference servers we find so that the first one in the
Etan Reisner <pidgin@unreliablesource.net>
parents:
28138
diff
changeset
|
307 js->chat_servers = g_list_reverse(js->chat_servers); |
2b9da4c0c47b
Reverse the list of conference servers we find so that the first one in the
Etan Reisner <pidgin@unreliablesource.net>
parents:
28138
diff
changeset
|
308 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 capabilities |= JABBER_CAP_RETRIEVED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 jbr->capabilities = capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
313 |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
314 if (jdicd && jdicd->callback) |
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
315 jdicd->callback(js, from, capabilities, jdicd->data); |
26680
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
316 } else { /* type == JABBER_IQ_ERROR or query == NULL */ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 JabberCapabilities capabilities = JABBER_CAP_NONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 if((jid = jabber_id_new(from))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
323 if(jid->resource && (jb = jabber_buddy_find(js, from, TRUE))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
324 jbr = jabber_buddy_find_resource(jb, jid->resource); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
326 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
327 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 capabilities = jbr->capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
330 |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
331 if (jdicd && jdicd->callback) |
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
332 jdicd->callback(js, from, capabilities, jdicd->data); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
333 } |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
334 |
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
335 g_free(jdicd); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
337 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
338 void jabber_disco_items_parse(JabberStream *js, const char *from, |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
339 JabberIqType type, const char *id, |
26569
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
340 xmlnode *query) |
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
341 { |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
342 if(type == JABBER_IQ_GET) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
343 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
344 "http://jabber.org/protocol/disco#items"); |
25443
5f9a24d1c25e
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25253
diff
changeset
|
345 |
17619
22c848c81ccd
Now preserving the node on the (empty) disco#items replies. This is required for apps to add items on the correct nodes using signals.
Andreas Monitzer <pidgin@monitzer.com>
parents:
17610
diff
changeset
|
346 /* preserve node */ |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
347 xmlnode *iq_query = xmlnode_get_child(iq->node, "query"); |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
348 const char *node = xmlnode_get_attrib(query, "node"); |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
349 if(node) |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
350 xmlnode_set_attrib(iq_query,"node",node); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
351 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
352 jabber_iq_set_id(iq, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
353 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
354 if (from) |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
355 xmlnode_set_attrib(iq->node, "to", from); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
357 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
358 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
359 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
361 jabber_disco_finish_server_info_result_cb(JabberStream *js) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
362 { |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
363 const char *ft_proxies; |
18163
703872bf33c6
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18153
diff
changeset
|
364 |
25831
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
365 /* |
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
366 * This *should* happen only if the server supports vcard-temp, but there |
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
367 * are apparently some servers that don't advertise it even though they |
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
368 * support it. |
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
369 */ |
18163
703872bf33c6
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18153
diff
changeset
|
370 jabber_vcard_fetch_mine(js); |
703872bf33c6
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18153
diff
changeset
|
371 |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
372 if (js->pep) |
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
373 jabber_avatar_fetch_mine(js); |
18163
703872bf33c6
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18153
diff
changeset
|
374 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
375 if (!(js->server_caps & JABBER_CAP_GOOGLE_ROSTER)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
376 /* If the server supports JABBER_CAP_GOOGLE_ROSTER; we will have already requested it */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
377 jabber_roster_request(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
378 } |
17438 | 379 |
17610
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
380 if (js->server_caps & JABBER_CAP_ADHOC) { |
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
381 /* The server supports ad-hoc commands, so let's request the list */ |
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
382 jabber_adhoc_server_get_list(js); |
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
383 } |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
384 |
24820
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
385 /* If the server supports blocking, request the block list */ |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
386 if (js->server_caps & JABBER_CAP_BLOCKING) { |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
387 jabber_request_block_list(js); |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
388 } |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
389 |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
390 /* If there are manually specified bytestream proxies, query them */ |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
391 ft_proxies = purple_account_get_string(js->gc->account, "ft_proxies", NULL); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
392 if (ft_proxies) { |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
393 JabberIq *iq; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
394 JabberBytestreamsStreamhost *sh; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
395 int i; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
396 char *tmp; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
397 gchar **ft_proxy_list = g_strsplit(ft_proxies, ",", 0); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
398 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
399 for(i = 0; ft_proxy_list[i]; i++) { |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
400 g_strstrip(ft_proxy_list[i]); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
401 if(!(*ft_proxy_list[i])) |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
402 continue; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
403 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
404 /* We used to allow specifying a port directly here; get rid of it */ |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
405 if((tmp = strchr(ft_proxy_list[i], ':'))) |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
406 *tmp = '\0'; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
407 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
408 sh = g_new0(JabberBytestreamsStreamhost, 1); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
409 sh->jid = g_strdup(ft_proxy_list[i]); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
410 js->bs_proxies = g_list_prepend(js->bs_proxies, sh); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
411 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
412 iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
413 "http://jabber.org/protocol/bytestreams"); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
414 xmlnode_set_attrib(iq->node, "to", sh->jid); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
415 jabber_iq_set_callback(iq, jabber_disco_bytestream_server_cb, sh); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
416 jabber_iq_send(iq); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
417 } |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
418 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
419 g_strfreev(ft_proxy_list); |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
420 } |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
421 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
422 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
423 |
28866
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
424 /* should probably share this code with google.c, or maybe from 2.7.0 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
425 introduce an abstracted hostname -> IP function in dns.c */ |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
426 static void |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
427 jabber_disco_stun_lookup_cb(GSList *hosts, gpointer data, |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
428 const char *error_message) |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
429 { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
430 JabberStream *js = (JabberStream *) data; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
431 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
432 if (error_message) { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
433 purple_debug_error("jabber", "STUN lookup failed: %s\n", |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
434 error_message); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
435 g_slist_free(hosts); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
436 js->stun_query = NULL; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
437 return; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
438 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
439 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
440 if (hosts && g_slist_next(hosts)) { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
441 struct sockaddr *addr = g_slist_next(hosts)->data; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
442 char dst[INET6_ADDRSTRLEN]; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
443 int port; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
444 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
445 if (addr->sa_family == AF_INET6) { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
446 inet_ntop(addr->sa_family, &((struct sockaddr_in6 *) addr)->sin6_addr, |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
447 dst, sizeof(dst)); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
448 port = ntohs(((struct sockaddr_in6 *) addr)->sin6_port); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
449 } else { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
450 inet_ntop(addr->sa_family, &((struct sockaddr_in *) addr)->sin_addr, |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
451 dst, sizeof(dst)); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
452 port = ntohs(((struct sockaddr_in *) addr)->sin_port); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
453 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
454 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
455 if (js->stun_ip) |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
456 g_free(js->stun_ip); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
457 js->stun_ip = g_strdup(dst); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
458 js->stun_port = port; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
459 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
460 purple_debug_info("jabber", "set STUN IP/port address: " |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
461 "%s:%d\n", dst, port); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
462 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
463 /* unmark ongoing query */ |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
464 js->stun_query = NULL; |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
465 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
466 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
467 while (hosts != NULL) { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
468 hosts = g_slist_delete_link(hosts, hosts); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
469 /* Free the address */ |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
470 g_free(hosts->data); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
471 hosts = g_slist_delete_link(hosts, hosts); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
472 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
473 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
474 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
475 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
476 static void |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
477 jabber_disco_stun_srv_resolve_cb(PurpleSrvResponse *resp, int results, gpointer data) |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
478 { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
479 JabberStream *js = (JabberStream *) data; |
28867
d6cc51c4e375
Removed a couple of stray whitespaces...
Marcus Lundblad <ml@update.uu.se>
parents:
28866
diff
changeset
|
480 |
28866
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
481 purple_debug_info("jabber", "got %d SRV responses for STUN.\n", results); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
482 js->srv_query_data = NULL; |
28867
d6cc51c4e375
Removed a couple of stray whitespaces...
Marcus Lundblad <ml@update.uu.se>
parents:
28866
diff
changeset
|
483 |
28866
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
484 if (results > 0) { |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
485 purple_debug_info("jabber", "looking up IP for %s:%d\n", |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
486 resp[0].hostname, resp[0].port); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
487 js->stun_query = |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
488 purple_dnsquery_a(resp[0].hostname, resp[0].port, |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
489 jabber_disco_stun_lookup_cb, js); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
490 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
491 } |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
492 |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
493 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 static void |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
495 jabber_disco_server_info_result_cb(JabberStream *js, const char *from, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
496 JabberIqType type, const char *id, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
497 xmlnode *packet, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
498 { |
17438 | 499 xmlnode *query, *child; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
501 if (!from || strcmp(from, js->user->domain)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
502 jabber_disco_finish_server_info_result_cb(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
504 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
505 |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
506 if (type == JABBER_IQ_ERROR) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 /* A common way to get here is for the server not to support xmlns http://jabber.org/protocol/disco#info */ |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 jabber_disco_finish_server_info_result_cb(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
512 query = xmlnode_get_child(packet, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
513 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
514 if (!query) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
515 jabber_disco_finish_server_info_result_cb(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
516 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 |
17438 | 519 for (child = xmlnode_get_child(query, "identity"); child; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
520 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
521 const char *category, *type, *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
522 category = xmlnode_get_attrib(child, "category"); |
17561
a75079eae085
added preliminary frame for pep-support
Andreas Monitzer <pidgin@monitzer.com>
parents:
17440
diff
changeset
|
523 type = xmlnode_get_attrib(child, "type"); |
19489
b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <pidgin@monitzer.com>
parents:
18685
diff
changeset
|
524 if(category && type && !strcmp(category, "pubsub") && !strcmp(type,"pep")) |
b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <pidgin@monitzer.com>
parents:
18685
diff
changeset
|
525 js->pep = TRUE; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
526 if (!category || strcmp(category, "server")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
527 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
528 if (!type || strcmp(type, "im")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
529 continue; |
17438 | 530 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
531 name = xmlnode_get_attrib(child, "name"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
532 if (!name) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
533 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
534 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
535 g_free(js->server_name); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
536 js->server_name = g_strdup(name); |
15523
ccbdf500f13a
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@gmail.com>
parents:
15374
diff
changeset
|
537 if (!strcmp(name, "Google Talk")) { |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
538 purple_debug_info("jabber", "Google Talk!\n"); |
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
539 js->googletalk = TRUE; |
26162
88f183f7dfc7
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <ml@update.uu.se>
parents:
26062
diff
changeset
|
540 |
88f183f7dfc7
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <ml@update.uu.se>
parents:
26062
diff
changeset
|
541 /* autodiscover stun and relays */ |
88f183f7dfc7
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <ml@update.uu.se>
parents:
26062
diff
changeset
|
542 jabber_google_send_jingle_info(js); |
88f183f7dfc7
Add automatic discovery of GTalk STUN servers when using a Gtalk account
Marcus Lundblad <ml@update.uu.se>
parents:
26062
diff
changeset
|
543 } else { |
28866
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
544 js->srv_query_data = |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
545 purple_srv_resolve("stun", "udp", js->user->domain, |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
546 jabber_disco_stun_srv_resolve_cb, js); |
fc8c85e8b6e1
jabber: Automatically find a STUN server by SRV lookup on the account's domain
Marcus Lundblad <ml@update.uu.se>
parents:
28398
diff
changeset
|
547 /* TODO: add TURN support later... */ |
26434
e23a74d7c97c
Get rid of the rest of the extraneous changes.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
26213
diff
changeset
|
548 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
549 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
550 |
17438 | 551 for (child = xmlnode_get_child(query, "feature"); child; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
552 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 const char *var; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 var = xmlnode_get_attrib(child, "var"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
555 if (!var) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
556 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 if (!strcmp("google:mail:notify", var)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 js->server_caps |= JABBER_CAP_GMAIL_NOTIFY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 jabber_gmail_init(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 } else if (!strcmp("google:roster", var)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
562 js->server_caps |= JABBER_CAP_GOOGLE_ROSTER; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 jabber_google_roster_init(js); |
17610
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
564 } else if (!strcmp("http://jabber.org/protocol/commands", var)) { |
9a19c46adf66
The server's ad-hoc commands are now listed in the account's action menu. Note that this requires an additional field in the _PurplePluginAction struct. There's no other way, since there was no way to supply user_data, and dynamically created functions are not supported by C. This should be fine, since that struct is only malloced in purple_plugin_action_new, which is part of the core. Applications have to either pass the struct unmodified, or restore the user_data pointer if the action is recreated when necessary (as is the case in Adium).
Andreas Monitzer <pidgin@monitzer.com>
parents:
17609
diff
changeset
|
565 js->server_caps |= JABBER_CAP_ADHOC; |
24820
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
566 } else if (!strcmp("urn:xmpp:blocking", var)) { |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
567 js->server_caps |= JABBER_CAP_BLOCKING; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
568 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
569 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
570 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 jabber_disco_finish_server_info_result_cb(js); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
572 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
573 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
574 static void |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
575 jabber_disco_server_items_result_cb(JabberStream *js, const char *from, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
576 JabberIqType type, const char *id, |
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
577 xmlnode *packet, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
578 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
579 xmlnode *query, *child; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
580 |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
581 if (!from || strcmp(from, js->user->domain) != 0) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
583 |
26547
ae41d8e827e3
Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
Paul Aurich <paul@darkrain42.org>
parents:
25983
diff
changeset
|
584 if (type == JABBER_IQ_ERROR) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
585 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
587 while(js->chat_servers) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 g_free(js->chat_servers->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 js->chat_servers = g_list_delete_link(js->chat_servers, js->chat_servers); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 query = xmlnode_get_child(packet, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
593 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 for(child = xmlnode_get_child(query, "item"); child; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 JabberIq *iq; |
17440
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
597 const char *jid, *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
598 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 if(!(jid = xmlnode_get_attrib(child, "jid"))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
600 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 |
17440
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
602 /* we don't actually care about the specific nodes, |
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
603 * so we won't query them */ |
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
604 if((node = xmlnode_get_attrib(child, "node"))) |
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
605 continue; |
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
606 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
607 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
608 xmlnode_set_attrib(iq->node, "to", jid); |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
609 jabber_iq_set_callback(iq, jabber_disco_info_cb, NULL); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
610 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
612 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
613 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 void jabber_disco_items_server(JabberStream *js) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
615 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
616 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 "http://jabber.org/protocol/disco#items"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
619 xmlnode_set_attrib(iq->node, "to", js->user->domain); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
620 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
621 jabber_iq_set_callback(iq, jabber_disco_server_items_result_cb, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
622 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 |
21603
a4b6854737d5
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 <daniel.atallah@gmail.com>
parents:
19696
diff
changeset
|
624 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 xmlnode_set_attrib(iq->node, "to", js->user->domain); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
626 jabber_iq_set_callback(iq, jabber_disco_server_info_result_cb, NULL); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
628 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
629 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 void jabber_disco_info_do(JabberStream *js, const char *who, JabberDiscoInfoCallback *callback, gpointer data) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
631 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
632 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
633 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 struct _jabber_disco_info_cb_data *jdicd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 JabberIq *iq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 if((jid = jabber_id_new(who))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 if(jid->resource && (jb = jabber_buddy_find(js, who, TRUE))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 jbr = jabber_buddy_find_resource(jb, jid->resource); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
642 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
643 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 if(jbr && jbr->capabilities & JABBER_CAP_RETRIEVED) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 callback(js, who, jbr->capabilities, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 jdicd = g_new0(struct _jabber_disco_info_cb_data, 1); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 jdicd->data = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 jdicd->callback = callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
652 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 xmlnode_set_attrib(iq->node, "to", who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
655 |
26680
1df3579a974b
Split the jabber_disco_info_do IQ callback from the IQ handler and use the IQ callback semantics.
Paul Aurich <paul@darkrain42.org>
parents:
26678
diff
changeset
|
656 jabber_iq_set_callback(iq, jabber_disco_info_cb, jdicd); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
658 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
659 |