Mercurial > pidgin.yaz
annotate libpurple/protocols/jabber/disco.c @ 29929:3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Mood messages is yet to be implemented in the UI (and replacing the current
account-specific mood setting for XMPP).
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Thu, 04 Mar 2010 22:14:03 +0000 |
parents | 4f3a9ddfa34e |
children | 7c871249318b ae615b3d3e47 |
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" |
29314
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
25 #include "network.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
26 #include "prefs.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
27 #include "debug.h" |
27053 | 28 #include "request.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
29 |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
30 #include "adhoccommands.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
31 #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
|
32 #include "disco.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
33 #include "google.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
34 #include "iq.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
35 #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
|
36 #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
|
37 #include "pep.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
38 #include "presence.h" |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
39 #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
|
40 #include "useravatar.h" |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
41 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
42 struct _jabber_disco_info_cb_data { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
43 gpointer data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
44 JabberDiscoInfoCallback *callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
45 }; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
46 |
26340
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
47 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
|
48 gpointer data; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
49 JabberDiscoItemsCallback *callback; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
50 }; |
b5fe3f47487b
jabber_disco_items_do(), which functions like jabber_disco_info_do.
Paul Aurich <paul@darkrain42.org>
parents:
26339
diff
changeset
|
51 |
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
|
52 #define SUPPORT_FEATURE(x) { \ |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
53 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
|
54 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
|
55 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
56 |
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
|
57 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
|
58 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
|
59 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
|
60 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
|
61 { |
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
|
62 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
|
63 xmlnode *query = xmlnode_get_child_with_namespace(packet, "query", |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
64 NS_BYTESTREAMS); |
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
|
65 |
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 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
|
67 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
|
68 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
|
69 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
|
70 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
|
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 |
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 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
|
74 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
|
75 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
|
76 |
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->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
|
78 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
|
79 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
|
80 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
|
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 |
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 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
|
85 "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
|
86 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
|
87 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
|
88 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
89 /* 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
|
90 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
|
91 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
|
92 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
|
93 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
|
94 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
|
95 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
|
96 } |
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
|
97 } |
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
|
98 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
99 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
100 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
|
101 JabberIqType type, const char *id, |
26569
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
102 xmlnode *in_query) |
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
103 { |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
104 if(type == JABBER_IQ_GET) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
105 xmlnode *query, *identity, *feature; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
106 JabberIq *iq; |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
107 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
|
108 char *node_uri = NULL; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
109 |
25760
f462fa160f06
Sprinkle around more support for xml:lang on JabberIdentities
Paul Aurich <paul@darkrain42.org>
parents:
25743
diff
changeset
|
110 /* create custom caps node URI */ |
25742
4040da08a733
Entity Capabilities must be per-JabberStream
Paul Aurich <paul@darkrain42.org>
parents:
25741
diff
changeset
|
111 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
|
112 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
113 iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, NS_DISCO_INFO); |
15374
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"); |
29026
7b4ade7c6d8a
jabber: Start putting all the namespaces in one location with consistent naming.
Paul Aurich <paul@darkrain42.org>
parents:
28867
diff
changeset
|
155 xmlnode_set_attrib(feature, "var", NS_GOOGLE_VOICE); |
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"); |
29026
7b4ade7c6d8a
jabber: Start putting all the namespaces in one location with consistent naming.
Paul Aurich <paul@darkrain42.org>
parents:
28867
diff
changeset
|
167 xmlnode_set_attrib(feature, "var", NS_GOOGLE_VIDEO); |
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"); |
29026
7b4ade7c6d8a
jabber: Start putting all the namespaces in one location with consistent naming.
Paul Aurich <paul@darkrain42.org>
parents:
28867
diff
changeset
|
179 xmlnode_set_attrib(feature, "var", NS_GOOGLE_CAMERA); |
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"); |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
192 xmlnode_set_namespace(inf, 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"); |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
207 xmlnode_set_namespace(bad_request, NS_XMPP_STANZAS); |
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
|
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 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
224 query = xmlnode_get_child_with_namespace(packet, "query", NS_DISCO_INFO); |
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
|
225 |
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 if (type == JABBER_IQ_RESULT && query) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
227 xmlnode *child; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
228 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
229 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
230 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
231 JabberCapabilities capabilities = JABBER_CAP_NONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
232 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
233 if((jid = jabber_id_new(from))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
234 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
|
235 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
|
236 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
237 } |
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 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
240 capabilities = jbr->capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
241 |
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
|
242 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
|
243 if(child->type != XMLNODE_TYPE_TAG) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
244 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
245 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
246 if(!strcmp(child->name, "identity")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
247 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
|
248 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
|
249 if(!category || !type) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
250 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
251 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
252 if(!strcmp(category, "conference") && !strcmp(type, "text")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
253 /* 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
|
254 /* 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
|
255 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
|
256 } 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
|
257 /* 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
|
258 js->user_directories = g_list_prepend(js->user_directories, g_strdup(from)); |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
259 } else if(!strcmp(category, "proxy") && !strcmp(type, NS_BYTESTREAMS)) { |
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
|
260 /* 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
|
261 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
|
262 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
|
263 |
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 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
|
265 |
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 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
|
267 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
|
268 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
|
269 |
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 iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
271 NS_BYTESTREAMS); |
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
|
272 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
|
273 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
|
274 jabber_iq_send(iq); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
275 } |
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 } else if(!strcmp(child->name, "feature")) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
278 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
|
279 if(!var) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
280 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
281 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
282 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
|
283 capabilities |= JABBER_CAP_SI; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
284 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
|
285 capabilities |= JABBER_CAP_SI_FILE_XFER; |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
286 else if(!strcmp(var, NS_BYTESTREAMS)) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
287 capabilities |= JABBER_CAP_BYTESTREAMS; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
288 else if(!strcmp(var, "jabber:iq:search")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
289 capabilities |= JABBER_CAP_IQ_SEARCH; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
290 else if(!strcmp(var, "jabber:iq:register")) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
291 capabilities |= JABBER_CAP_IQ_REGISTER; |
29026
7b4ade7c6d8a
jabber: Start putting all the namespaces in one location with consistent naming.
Paul Aurich <paul@darkrain42.org>
parents:
28867
diff
changeset
|
292 else if(!strcmp(var, NS_PING)) |
17562
6ab1089e2101
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <pidgin@monitzer.com>
parents:
17561
diff
changeset
|
293 capabilities |= JABBER_CAP_PING; |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
294 else if(!strcmp(var, NS_DISCO_ITEMS)) |
26329
f5e613e05332
Applied disco-2.patch from nops with some modifications:
Paul Aurich <paul@darkrain42.org>
parents:
25443
diff
changeset
|
295 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
|
296 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
|
297 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
|
298 } |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
299 else if(!strcmp(var, NS_IBB)) { |
23999
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
300 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
|
301 capabilities |= JABBER_CAP_IBB; |
b4ec5481a67a
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <ml@update.uu.se>
parents:
23645
diff
changeset
|
302 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
303 } |
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 |
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
|
306 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
|
307 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
308 capabilities |= JABBER_CAP_RETRIEVED; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
309 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
310 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
311 jbr->capabilities = capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
312 |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
313 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
|
314 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
|
315 } 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
|
316 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
317 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
318 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
319 JabberCapabilities capabilities = JABBER_CAP_NONE; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
320 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
321 if((jid = jabber_id_new(from))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
322 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
|
323 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
|
324 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
325 } |
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 if(jbr) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
328 capabilities = jbr->capabilities; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
329 |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
330 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
|
331 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
|
332 } |
27616
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
333 |
d953b613a794
Fix picking up SI streamhosts from login server and plug a leak.
Paul Aurich <paul@darkrain42.org>
parents:
27136
diff
changeset
|
334 g_free(jdicd); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
335 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
336 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
337 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
|
338 JabberIqType type, const char *id, |
26569
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
339 xmlnode *query) |
bc7fac8e2f79
propagate from branch 'im.pidgin.pidgin' (head f144c6bda9daf701aa891c875fce7a4dedd611ae)
Paul Aurich <paul@darkrain42.org>
diff
changeset
|
340 { |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
341 if(type == JABBER_IQ_GET) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
342 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
343 NS_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
|
344 |
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
|
345 /* preserve node */ |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
346 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
|
347 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
|
348 if(node) |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
349 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
|
350 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
351 jabber_iq_set_id(iq, id); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
352 |
25933
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
353 if (from) |
050052891c55
Pass IQ handlers type, from, id, and the child node
Paul Aurich <paul@darkrain42.org>
parents:
25923
diff
changeset
|
354 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
|
355 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
356 } |
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 static void |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
360 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
|
361 { |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
362 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
|
363 |
25831
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
364 /* |
0fa91206cf5a
Always publish a <photo/> element, even if we have an empty buddy icon.
Paul Aurich <paul@darkrain42.org>
parents:
25817
diff
changeset
|
365 * 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
|
366 * 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
|
367 * 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
|
368 */ |
18163
703872bf33c6
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18153
diff
changeset
|
369 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
|
370 |
25817
9195955395b6
Only (re)publish XMPP avatars at login if the server's avatar differs
Paul Aurich <paul@darkrain42.org>
parents:
24820
diff
changeset
|
371 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
|
372 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
|
373 |
29149
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
29031
diff
changeset
|
374 /* Yes, please! */ |
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
29031
diff
changeset
|
375 jabber_roster_request(js); |
17438 | 376 |
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
|
377 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
|
378 /* 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
|
379 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
|
380 } |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
381 |
24820
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
382 /* 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
|
383 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
|
384 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
|
385 } |
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
386 |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
387 /* 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
|
388 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
|
389 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
|
390 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
|
391 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
|
392 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
|
393 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
|
394 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
|
395 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
396 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
|
397 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
|
398 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
|
399 continue; |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
400 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
401 /* 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
|
402 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
|
403 *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
|
404 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
405 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
|
406 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
|
407 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
|
408 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
409 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_BYTESTREAMS); |
23645
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
410 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
|
411 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
|
412 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
|
413 } |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
414 |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
415 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
|
416 } |
10382f1e1353
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21603
diff
changeset
|
417 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
418 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
419 |
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
|
420 /* 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
|
421 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
|
422 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
|
423 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
|
424 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
|
425 { |
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 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
|
427 |
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 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
|
429 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
|
430 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
|
431 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
|
432 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
|
433 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
|
434 } |
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 |
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 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
|
437 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
|
438 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
|
439 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
|
440 |
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 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
|
442 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
|
443 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
|
444 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
|
445 } 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
|
446 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
|
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_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
|
449 } |
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 |
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 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
|
452 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
|
453 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
|
454 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
|
455 |
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 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
|
457 "%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
|
458 |
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 /* 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
|
460 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
|
461 } |
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 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
|
464 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
|
465 /* 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
|
466 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
|
467 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
|
468 } |
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 } |
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 |
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 |
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 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
|
473 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
|
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 JabberStream *js = (JabberStream *) data; |
28867
d6cc51c4e375
Removed a couple of stray whitespaces...
Marcus Lundblad <ml@update.uu.se>
parents:
28866
diff
changeset
|
476 |
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
|
477 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
|
478 js->srv_query_data = NULL; |
28867
d6cc51c4e375
Removed a couple of stray whitespaces...
Marcus Lundblad <ml@update.uu.se>
parents:
28866
diff
changeset
|
479 |
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
|
480 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
|
481 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
|
482 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
|
483 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
|
484 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
|
485 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
|
486 } |
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 } |
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 |
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 |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
490 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
|
491 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
|
492 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
|
493 xmlnode *packet, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
494 { |
17438 | 495 xmlnode *query, *child; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
496 |
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
|
497 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
|
498 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
|
499 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
500 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
501 |
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
|
502 if (type == JABBER_IQ_ERROR) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
503 /* 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
|
504 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
|
505 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
506 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
507 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
508 query = xmlnode_get_child(packet, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
509 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
510 if (!query) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
511 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
|
512 return; |
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 |
17438 | 515 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
|
516 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
517 const char *category, *type, *name; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
518 category = xmlnode_get_attrib(child, "category"); |
17561
a75079eae085
added preliminary frame for pep-support
Andreas Monitzer <pidgin@monitzer.com>
parents:
17440
diff
changeset
|
519 type = xmlnode_get_attrib(child, "type"); |
29929
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29314
diff
changeset
|
520 if(category && type && !strcmp(category, "pubsub") && !strcmp(type,"pep")) { |
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29314
diff
changeset
|
521 PurpleConnection *gc = js->gc; |
19489
b0733d5d7621
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <pidgin@monitzer.com>
parents:
18685
diff
changeset
|
522 js->pep = TRUE; |
29929
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29314
diff
changeset
|
523 gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS | |
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29314
diff
changeset
|
524 PURPLE_CONNECTION_SUPPORT_MOOD_MESSAGES; |
3e5bb4e2334c
Added PurpleConnection flags to determine support for moods and mood messages.
Marcus Lundblad <ml@update.uu.se>
parents:
29314
diff
changeset
|
525 } |
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 */ |
29314
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
542 if (purple_network_get_stun_ip() == NULL || |
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
543 purple_strequal(purple_network_get_stun_ip(), "")) { |
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
544 jabber_google_send_jingle_info(js); |
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
545 } |
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
546 } else if (purple_network_get_stun_ip() == NULL || |
4f3a9ddfa34e
jabber: Only make the SRV lookup for STUN based on the domain if no STUN
Marcus Lundblad <ml@update.uu.se>
parents:
29149
diff
changeset
|
547 purple_strequal(purple_network_get_stun_ip(), "")) { |
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
|
548 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
|
549 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
|
550 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
|
551 /* 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
|
552 } |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
553 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
554 |
17438 | 555 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
|
556 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
557 const char *var; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
558 var = xmlnode_get_attrib(child, "var"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
559 if (!var) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
560 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
561 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
562 if (!strcmp(NS_GOOGLE_MAIL_NOTIFY, var)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
563 js->server_caps |= JABBER_CAP_GMAIL_NOTIFY; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
564 jabber_gmail_init(js); |
29149
9ab75ab032b4
jabber: The google roster request code was so lonely, so let's just drop-kick it and add the little custom logic to roster.c
Paul Aurich <paul@darkrain42.org>
parents:
29031
diff
changeset
|
565 } else if (!strcmp(NS_GOOGLE_ROSTER, var)) { |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
566 js->server_caps |= JABBER_CAP_GOOGLE_ROSTER; |
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
|
567 } 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
|
568 js->server_caps |= JABBER_CAP_ADHOC; |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
569 } else if (!strcmp(NS_SIMPLE_BLOCKING, var)) { |
24820
0700833f0c5d
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <mark@kingant.net>
parents:
23645
diff
changeset
|
570 js->server_caps |= JABBER_CAP_BLOCKING; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
571 } |
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 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
|
575 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
576 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
577 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
|
578 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
|
579 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
|
580 xmlnode *packet, gpointer data) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
581 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
582 xmlnode *query, *child; |
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 (!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
|
585 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
586 |
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
|
587 if (type == JABBER_IQ_ERROR) |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
588 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
589 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
590 while(js->chat_servers) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
591 g_free(js->chat_servers->data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
592 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
|
593 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
594 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
595 query = xmlnode_get_child(packet, "query"); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
596 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
597 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
|
598 child = xmlnode_get_next_twin(child)) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
599 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
|
600 const char *jid, *node; |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
601 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
602 if(!(jid = xmlnode_get_attrib(child, "jid"))) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
603 continue; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
604 |
17440
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
605 /* 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
|
606 * 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
|
607 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
|
608 continue; |
d42de194a364
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17438
diff
changeset
|
609 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
610 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_INFO); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
611 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
|
612 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
|
613 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
614 } |
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 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
617 void jabber_disco_items_server(JabberStream *js) |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
618 { |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
619 JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_ITEMS); |
15374
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 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
|
622 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
623 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
|
624 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
625 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
626 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_INFO); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
627 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
|
628 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
|
629 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
630 } |
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 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
|
633 { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
634 JabberID *jid; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
635 JabberBuddy *jb; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
636 JabberBuddyResource *jbr = NULL; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
637 struct _jabber_disco_info_cb_data *jdicd; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
638 JabberIq *iq; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
639 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
640 if((jid = jabber_id_new(who))) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
641 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
|
642 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
|
643 jabber_id_free(jid); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
644 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
645 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
646 if(jbr && jbr->capabilities & JABBER_CAP_RETRIEVED) { |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
647 callback(js, who, jbr->capabilities, data); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
648 return; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
649 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
650 |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
651 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
|
652 jdicd->data = data; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
653 jdicd->callback = callback; |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
654 |
29031
9ae3e70a327b
jabber: More namespaces! This is a good stopping point for now.
Paul Aurich <paul@darkrain42.org>
parents:
29026
diff
changeset
|
655 iq = jabber_iq_new_query(js, JABBER_IQ_GET, NS_DISCO_INFO); |
15374
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
656 xmlnode_set_attrib(iq->node, "to", who); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
657 |
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
|
658 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
|
659 jabber_iq_send(iq); |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
660 } |
5fe8042783c1
Rename gtk/ and libgaim/ to pidgin/ and libpurple/
Sean Egan <seanegan@gmail.com>
parents:
diff
changeset
|
661 |