Mon, 30 Mar 2009 00:42:15 +0000
Hide the structs, add accessors, and fix various smaller things:
* Make the flags an enum instead of #defines
* There were two sets of _in_progress functions, removed one.
* Adjusted a few return types to match usage
* Move the fetch_count into the prpl's protocol_data (which is no longer
the JabberStream but a dedicated struct)
| 8312 | 1 | /* |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
2 | * purple - Jabber Service Discovery |
| 8312 | 3 | * |
| 4 | * Copyright (C) 2003, Nathan Walp <faceprint@faceprint.com> | |
| 5 | * | |
| 6 | * This program is free software; you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation; either version 2 of the License, or | |
| 9 | * (at your option) any later version. | |
| 10 | * | |
| 11 | * This program is distributed in the hope that it will be useful, | |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | * GNU General Public License for more details. | |
| 15 | * | |
| 16 | * You should have received a copy of the GNU General Public License | |
| 17 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19832
diff
changeset
|
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 8312 | 19 | * |
| 20 | */ | |
| 21 | ||
| 22 | #include "internal.h" | |
| 23 | #include "prefs.h" | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
24 | #include "debug.h" |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
25 | #include "request.h" |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
26 | #include "notify.h" |
| 8312 | 27 | |
| 28 | #include "buddy.h" | |
| 15225 | 29 | #include "google.h" |
| 8312 | 30 | #include "iq.h" |
| 31 | #include "disco.h" | |
| 13385 | 32 | #include "jabber.h" |
|
15344
34b7f4e55861
[gaim-migrate @ 18072]
Evan Schoenberg <evands@pidgin.im>
parents:
15323
diff
changeset
|
33 | #include "presence.h" |
| 15265 | 34 | #include "roster.h" |
|
17768
7be011945a1b
added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
17423
diff
changeset
|
35 | #include "pep.h" |
|
17816
1b7362b4a7a2
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 <am@adiumx.com>
parents:
17783
diff
changeset
|
36 | #include "adhoccommands.h" |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
37 | #include "xdata.h" |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
38 | #include "libpurple/disco.h" |
| 8312 | 39 | |
| 40 | struct _jabber_disco_info_cb_data { | |
| 41 | gpointer data; | |
| 42 | JabberDiscoInfoCallback *callback; | |
| 43 | }; | |
| 44 | ||
|
17783
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
45 | #define SUPPORT_FEATURE(x) { \ |
| 8312 | 46 | feature = xmlnode_new_child(query, "feature"); \ |
|
17783
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
47 | xmlnode_set_attrib(feature, "var", x); \ |
|
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
48 | } |
| 8312 | 49 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
50 | struct jabber_disco_list_data { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
51 | char *server; |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
52 | int fetch_count; |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
53 | }; |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
54 | |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
55 | static void |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
56 | jabber_disco_bytestream_server_cb(JabberStream *js, xmlnode *packet, gpointer data) { |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
57 | JabberBytestreamsStreamhost *sh = data; |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
58 | const char *from = xmlnode_get_attrib(packet, "from"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
59 | xmlnode *query = xmlnode_get_child_with_namespace(packet, "query", |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
60 | "http://jabber.org/protocol/bytestreams"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
61 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
62 | if (from && !strcmp(from, sh->jid) && query != NULL) { |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
63 | xmlnode *sh_node = xmlnode_get_child(query, "streamhost"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
64 | if (sh_node) { |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
65 | const char *jid = xmlnode_get_attrib(sh_node, "jid"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
66 | const char *port = xmlnode_get_attrib(sh_node, "port"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
67 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
68 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
69 | if (jid == NULL || strcmp(jid, from) != 0) |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
70 | purple_debug_error("jabber", "Invalid jid(%s) for bytestream.\n", |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
71 | jid ? jid : "(null)"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
72 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
73 | sh->host = g_strdup(xmlnode_get_attrib(sh_node, "host")); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
74 | sh->zeroconf = g_strdup(xmlnode_get_attrib(sh_node, "zeroconf")); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
75 | if (port != NULL) |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
76 | sh->port = atoi(port); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
77 | } |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
78 | } |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
79 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
80 | purple_debug_info("jabber", "Discovered bytestream proxy server: " |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
81 | "jid='%s' host='%s' port='%d' zeroconf='%s'\n", |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
82 | from ? from : "", sh->host ? sh->host : "", |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
83 | sh->port, sh->zeroconf ? sh->zeroconf : ""); |
|
23912
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
84 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
85 | /* TODO: When we support zeroconf proxies, fix this to handle them */ |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
86 | if (!(sh->jid && sh->host && sh->port > 0)) { |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
87 | g_free(sh->jid); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
88 | g_free(sh->host); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
89 | g_free(sh->zeroconf); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
90 | g_free(sh); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
91 | js->bs_proxies = g_list_remove(js->bs_proxies, sh); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
92 | } |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
93 | } |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
94 | |
| 8312 | 95 | |
| 96 | void jabber_disco_info_parse(JabberStream *js, xmlnode *packet) { | |
| 97 | const char *from = xmlnode_get_attrib(packet, "from"); | |
| 98 | const char *type = xmlnode_get_attrib(packet, "type"); | |
| 99 | ||
| 100 | if(!from || !type) | |
| 101 | return; | |
| 102 | ||
| 103 | if(!strcmp(type, "get")) { | |
| 104 | xmlnode *query, *identity, *feature; | |
| 13385 | 105 | JabberIq *iq; |
| 106 | ||
| 107 | xmlnode *in_query; | |
| 108 | const char *node = NULL; | |
| 109 | ||
| 110 | if((in_query = xmlnode_get_child(packet, "query"))) { | |
| 111 | node = xmlnode_get_attrib(in_query, "node"); | |
| 112 | } | |
| 113 | ||
| 114 | ||
| 115 | iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, | |
| 8312 | 116 | "http://jabber.org/protocol/disco#info"); |
| 117 | ||
| 118 | jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id")); | |
| 119 | ||
| 120 | xmlnode_set_attrib(iq->node, "to", from); | |
| 121 | query = xmlnode_get_child(iq->node, "query"); | |
| 122 | ||
| 13385 | 123 | if(node) |
| 124 | xmlnode_set_attrib(query, "node", node); | |
| 125 | ||
| 126 | if(!node || !strcmp(node, CAPS0115_NODE "#" VERSION)) { | |
| 127 | identity = xmlnode_new_child(query, "identity"); | |
| 128 | xmlnode_set_attrib(identity, "category", "client"); | |
| 129 | xmlnode_set_attrib(identity, "type", "pc"); /* XXX: bot, console, | |
| 130 | * handheld, pc, phone, | |
| 131 | * web */ | |
| 13704 | 132 | xmlnode_set_attrib(identity, "name", PACKAGE); |
| 8312 | 133 | |
| 13385 | 134 | SUPPORT_FEATURE("jabber:iq:last") |
| 135 | SUPPORT_FEATURE("jabber:iq:oob") | |
| 136 | SUPPORT_FEATURE("jabber:iq:time") | |
|
18317
6c814e134e56
support replying to XEP-0202 queries
Nathan Walp <nwalp@pidgin.im>
parents:
18235
diff
changeset
|
137 | SUPPORT_FEATURE("xmpp:urn:time") |
| 13385 | 138 | SUPPORT_FEATURE("jabber:iq:version") |
| 139 | SUPPORT_FEATURE("jabber:x:conference") | |
| 140 | SUPPORT_FEATURE("http://jabber.org/protocol/bytestreams") | |
| 141 | SUPPORT_FEATURE("http://jabber.org/protocol/disco#info") | |
| 142 | SUPPORT_FEATURE("http://jabber.org/protocol/disco#items") | |
|
24372
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23912
diff
changeset
|
143 | SUPPORT_FEATURE("http://jabber.org/protocol/ibb"); |
| 13385 | 144 | SUPPORT_FEATURE("http://jabber.org/protocol/muc") |
| 145 | SUPPORT_FEATURE("http://jabber.org/protocol/muc#user") | |
| 146 | SUPPORT_FEATURE("http://jabber.org/protocol/si") | |
| 147 | SUPPORT_FEATURE("http://jabber.org/protocol/si/profile/file-transfer") | |
| 148 | SUPPORT_FEATURE("http://jabber.org/protocol/xhtml-im") | |
|
18181
736c6abf62f4
respond to XEP-0199 queries (XMPP ping)
Nathan Walp <nwalp@pidgin.im>
parents:
17423
diff
changeset
|
149 | SUPPORT_FEATURE("urn:xmpp:ping") |
|
17769
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
17768
diff
changeset
|
150 | SUPPORT_FEATURE("http://www.xmpp.org/extensions/xep-0199.html#ns") |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
151 | |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
152 | if(!node) { /* non-caps disco#info, add all enabled extensions */ |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
153 | GList *features; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
154 | for(features = jabber_features; features; features = features->next) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
155 | JabberFeature *feat = (JabberFeature*)features->data; |
|
17783
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
156 | if(feat->is_enabled == NULL || feat->is_enabled(js, feat->shortname, feat->namespace) == TRUE) |
|
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
157 | SUPPORT_FEATURE(feat->namespace); |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
158 | } |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
159 | } |
| 13385 | 160 | } else { |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
161 | const char *ext = NULL; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
162 | unsigned pos; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
163 | unsigned nodelen = strlen(node); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
164 | unsigned capslen = strlen(CAPS0115_NODE); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
165 | /* do a basic plausability check */ |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
166 | if(nodelen > capslen+1) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
167 | /* verify that the string is CAPS0115#<ext> and get the pointer to the ext part */ |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
168 | for(pos = 0; pos < capslen+1; ++pos) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
169 | if(pos == capslen) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
170 | if(node[pos] == '#') |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
171 | ext = &node[pos+1]; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
172 | else |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
173 | break; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
174 | } else if(node[pos] != CAPS0115_NODE[pos]) |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
175 | break; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
176 | } |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
177 | |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
178 | if(ext != NULL) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
179 | /* look for that ext */ |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
180 | GList *features; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
181 | for(features = jabber_features; features; features = features->next) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
182 | JabberFeature *feat = (JabberFeature*)features->data; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
183 | if(!strcmp(feat->shortname, ext)) { |
|
17783
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
184 | SUPPORT_FEATURE(feat->namespace); |
|
2687df1ca202
PEP publishing features are now only announced in disco#info when PEP is supported by the server.
Andreas Monitzer <am@adiumx.com>
parents:
17773
diff
changeset
|
185 | break; |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
186 | } |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
187 | } |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
188 | if(features == NULL) |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
189 | ext = NULL; |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
190 | } |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
191 | } |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
192 | |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
193 | if(ext == NULL) { |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
194 | xmlnode *error, *inf; |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
195 | |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
196 | /* XXX: gross hack, implement jabber_iq_set_type or something */ |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
197 | xmlnode_set_attrib(iq->node, "type", "error"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
198 | iq->type = JABBER_IQ_ERROR; |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
199 | |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
200 | error = xmlnode_new_child(query, "error"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
201 | xmlnode_set_attrib(error, "code", "404"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
202 | xmlnode_set_attrib(error, "type", "cancel"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
203 | inf = xmlnode_new_child(error, "item-not-found"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
204 | xmlnode_set_namespace(inf, "urn:ietf:params:xml:ns:xmpp-stanzas"); |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
205 | } |
| 13385 | 206 | } |
| 8312 | 207 | |
| 208 | jabber_iq_send(iq); | |
| 209 | } else if(!strcmp(type, "result")) { | |
| 210 | xmlnode *query = xmlnode_get_child(packet, "query"); | |
| 211 | xmlnode *child; | |
| 212 | JabberID *jid; | |
| 213 | JabberBuddy *jb; | |
| 214 | JabberBuddyResource *jbr = NULL; | |
| 215 | JabberCapabilities capabilities = JABBER_CAP_NONE; | |
| 216 | struct _jabber_disco_info_cb_data *jdicd; | |
| 217 | ||
| 218 | if((jid = jabber_id_new(from))) { | |
| 219 | if(jid->resource && (jb = jabber_buddy_find(js, from, TRUE))) | |
| 220 | jbr = jabber_buddy_find_resource(jb, jid->resource); | |
| 221 | jabber_id_free(jid); | |
| 222 | } | |
| 223 | ||
| 224 | if(jbr) | |
| 225 | capabilities = jbr->capabilities; | |
| 226 | ||
| 227 | for(child = query->child; child; child = child->next) { | |
| 228 | if(child->type != XMLNODE_TYPE_TAG) | |
| 229 | continue; | |
| 230 | ||
| 231 | if(!strcmp(child->name, "identity")) { | |
| 232 | const char *category = xmlnode_get_attrib(child, "category"); | |
| 233 | const char *type = xmlnode_get_attrib(child, "type"); | |
| 234 | if(!category || !type) | |
| 235 | continue; | |
| 236 | ||
| 11675 | 237 | if(!strcmp(category, "conference") && !strcmp(type, "text")) { |
| 238 | /* we found a groupchat or MUC server, add it to the list */ | |
| 239 | /* XXX: actually check for protocol/muc or gc-1.0 support */ | |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
240 | js->chat_servers = g_list_prepend(js->chat_servers, g_strdup(from)); |
| 11675 | 241 | } else if(!strcmp(category, "directory") && !strcmp(type, "user")) { |
| 242 | /* we found a JUD */ | |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
243 | js->user_directories = g_list_prepend(js->user_directories, g_strdup(from)); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
244 | } else if(!strcmp(category, "proxy") && !strcmp(type, "bytestreams")) { |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
245 | /* This is a bytestream proxy */ |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
246 | JabberIq *iq; |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
247 | JabberBytestreamsStreamhost *sh; |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
248 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
249 | purple_debug_info("jabber", "Found bytestream proxy server: %s\n", from); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
250 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
251 | sh = g_new0(JabberBytestreamsStreamhost, 1); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
252 | sh->jid = g_strdup(from); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
253 | js->bs_proxies = g_list_prepend(js->bs_proxies, sh); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
254 | |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
255 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
256 | "http://jabber.org/protocol/bytestreams"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
257 | xmlnode_set_attrib(iq->node, "to", sh->jid); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
258 | jabber_iq_set_callback(iq, jabber_disco_bytestream_server_cb, sh); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
259 | jabber_iq_send(iq); |
| 11675 | 260 | } |
| 8312 | 261 | |
| 262 | } else if(!strcmp(child->name, "feature")) { | |
| 263 | const char *var = xmlnode_get_attrib(child, "var"); | |
| 264 | if(!var) | |
| 265 | continue; | |
| 266 | ||
| 267 | if(!strcmp(var, "http://jabber.org/protocol/si")) | |
| 268 | capabilities |= JABBER_CAP_SI; | |
| 269 | else if(!strcmp(var, "http://jabber.org/protocol/si/profile/file-transfer")) | |
| 270 | capabilities |= JABBER_CAP_SI_FILE_XFER; | |
| 271 | else if(!strcmp(var, "http://jabber.org/protocol/bytestreams")) | |
| 272 | capabilities |= JABBER_CAP_BYTESTREAMS; | |
| 11675 | 273 | else if(!strcmp(var, "jabber:iq:search")) |
| 274 | capabilities |= JABBER_CAP_IQ_SEARCH; | |
| 275 | else if(!strcmp(var, "jabber:iq:register")) | |
| 276 | capabilities |= JABBER_CAP_IQ_REGISTER; | |
|
17769
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
17768
diff
changeset
|
277 | else if(!strcmp(var, "http://www.xmpp.org/extensions/xep-0199.html#ns")) |
|
69d98a4da006
applied patch for supporting XEP-0199: XMPP Ping
Andreas Monitzer <am@adiumx.com>
parents:
17768
diff
changeset
|
278 | capabilities |= JABBER_CAP_PING; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
279 | else if(!strcmp(var, "http://jabber.org/protocol/disco#items")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
280 | capabilities |= JABBER_CAP_ITEMS; |
|
17816
1b7362b4a7a2
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 <am@adiumx.com>
parents:
17783
diff
changeset
|
281 | else if(!strcmp(var, "http://jabber.org/protocol/commands")) { |
|
1b7362b4a7a2
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 <am@adiumx.com>
parents:
17783
diff
changeset
|
282 | capabilities |= JABBER_CAP_ADHOC; |
|
1b7362b4a7a2
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 <am@adiumx.com>
parents:
17783
diff
changeset
|
283 | } |
|
24372
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23912
diff
changeset
|
284 | else if(!strcmp(var, "http://jabber.org/protocol/ibb")) { |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23912
diff
changeset
|
285 | purple_debug_info("jabber", "remote supports IBB\n"); |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23912
diff
changeset
|
286 | capabilities |= JABBER_CAP_IBB; |
|
830701cec96f
Implements file transfers using in-band bytestreams for XMPP
Marcus Lundblad <malu@pidgin.im>
parents:
23912
diff
changeset
|
287 | } |
| 8312 | 288 | } |
| 289 | } | |
| 290 | ||
| 291 | capabilities |= JABBER_CAP_RETRIEVED; | |
| 292 | ||
| 293 | if(jbr) | |
| 294 | jbr->capabilities = capabilities; | |
| 295 | ||
| 296 | if((jdicd = g_hash_table_lookup(js->disco_callbacks, from))) { | |
| 297 | jdicd->callback(js, from, capabilities, jdicd->data); | |
| 298 | g_hash_table_remove(js->disco_callbacks, from); | |
| 299 | } | |
| 300 | } else if(!strcmp(type, "error")) { | |
| 301 | JabberID *jid; | |
| 302 | JabberBuddy *jb; | |
| 303 | JabberBuddyResource *jbr = NULL; | |
| 304 | JabberCapabilities capabilities = JABBER_CAP_NONE; | |
| 305 | struct _jabber_disco_info_cb_data *jdicd; | |
| 306 | ||
| 307 | if(!(jdicd = g_hash_table_lookup(js->disco_callbacks, from))) | |
| 308 | return; | |
| 309 | ||
| 310 | if((jid = jabber_id_new(from))) { | |
| 311 | if(jid->resource && (jb = jabber_buddy_find(js, from, TRUE))) | |
| 312 | jbr = jabber_buddy_find_resource(jb, jid->resource); | |
| 313 | jabber_id_free(jid); | |
| 314 | } | |
| 315 | ||
| 316 | if(jbr) | |
| 317 | capabilities = jbr->capabilities; | |
| 318 | ||
| 319 | jdicd->callback(js, from, capabilities, jdicd->data); | |
| 320 | g_hash_table_remove(js->disco_callbacks, from); | |
| 321 | } | |
| 322 | } | |
| 323 | ||
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
324 | void jabber_disco_items_parse(JabberStream *js, xmlnode *packet) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
325 | { |
| 8312 | 326 | const char *from = xmlnode_get_attrib(packet, "from"); |
| 327 | const char *type = xmlnode_get_attrib(packet, "type"); | |
| 328 | ||
| 14356 | 329 | if(type && !strcmp(type, "get")) { |
| 8312 | 330 | JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_RESULT, |
| 331 | "http://jabber.org/protocol/disco#items"); | |
|
26042
4dabdb5fe213
Remove some extra trailing whitespace I noticed after merging mlundblad's
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26026
diff
changeset
|
332 | |
|
17826
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
333 | /* preserve node */ |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
334 | xmlnode *iq_query = xmlnode_get_child_with_namespace(iq->node,"query","http://jabber.org/protocol/disco#items"); |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
335 | if(iq_query) { |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
336 | xmlnode *query = xmlnode_get_child_with_namespace(packet,"query","http://jabber.org/protocol/disco#items"); |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
337 | if(query) { |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
338 | const char *node = xmlnode_get_attrib(query,"node"); |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
339 | if(node) |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
340 | xmlnode_set_attrib(iq_query,"node",node); |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
341 | } |
|
8f31a68b1d70
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 <am@adiumx.com>
parents:
17817
diff
changeset
|
342 | } |
| 8312 | 343 | |
| 344 | jabber_iq_set_id(iq, xmlnode_get_attrib(packet, "id")); | |
| 345 | ||
| 346 | xmlnode_set_attrib(iq->node, "to", from); | |
| 347 | jabber_iq_send(iq); | |
| 348 | } | |
| 349 | } | |
| 350 | ||
| 351 | static void | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
352 | jabber_disco_finish_server_info_result_cb(JabberStream *js) |
| 15197 | 353 | { |
|
23912
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
354 | const char *ft_proxies; |
|
18235
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18225
diff
changeset
|
355 | |
|
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18225
diff
changeset
|
356 | jabber_vcard_fetch_mine(js); |
|
60a9bd99f035
server-side jabber vcards now take precedence over local vcards, so
Nathan Walp <nwalp@pidgin.im>
parents:
18225
diff
changeset
|
357 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
358 | if (!(js->server_caps & JABBER_CAP_GOOGLE_ROSTER)) { |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
359 | /* If the server supports JABBER_CAP_GOOGLE_ROSTER; we will have already requested it */ |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
360 | jabber_roster_request(js); |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
361 | } |
| 17421 | 362 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
363 | /* Send initial presence; this will trigger receipt of presence for contacts on the roster */ |
|
18719
7a0465381cea
Fixed errors created by merge conflict resolve mistakes.
Andreas Monitzer <am@adiumx.com>
parents:
18718
diff
changeset
|
364 | jabber_presence_send(js->gc->account, NULL); |
|
23912
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
365 | |
|
17817
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
366 | if (js->server_caps & JABBER_CAP_ADHOC) { |
|
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
367 | /* The server supports ad-hoc commands, so let's request the list */ |
|
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
368 | jabber_adhoc_server_get_list(js); |
|
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
369 | } |
|
23912
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
370 | |
|
25290
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
371 | /* If the server supports blocking, request the block list */ |
|
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
372 | if (js->server_caps & JABBER_CAP_BLOCKING) { |
|
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
373 | jabber_request_block_list(js); |
|
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
374 | } |
|
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
375 | |
|
23912
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
376 | /* If there are manually specified bytestream proxies, query them */ |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
377 | ft_proxies = purple_account_get_string(js->gc->account, "ft_proxies", NULL); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
378 | if (ft_proxies) { |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
379 | JabberIq *iq; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
380 | JabberBytestreamsStreamhost *sh; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
381 | int i; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
382 | char *tmp; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
383 | gchar **ft_proxy_list = g_strsplit(ft_proxies, ",", 0); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
384 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
385 | for(i = 0; ft_proxy_list[i]; i++) { |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
386 | g_strstrip(ft_proxy_list[i]); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
387 | if(!(*ft_proxy_list[i])) |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
388 | continue; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
389 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
390 | /* We used to allow specifying a port directly here; get rid of it */ |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
391 | if((tmp = strchr(ft_proxy_list[i], ':'))) |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
392 | *tmp = '\0'; |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
393 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
394 | sh = g_new0(JabberBytestreamsStreamhost, 1); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
395 | sh->jid = g_strdup(ft_proxy_list[i]); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
396 | js->bs_proxies = g_list_prepend(js->bs_proxies, sh); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
397 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
398 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
399 | "http://jabber.org/protocol/bytestreams"); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
400 | xmlnode_set_attrib(iq->node, "to", sh->jid); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
401 | jabber_iq_set_callback(iq, jabber_disco_bytestream_server_cb, sh); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
402 | jabber_iq_send(iq); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
403 | } |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
404 | |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
405 | g_strfreev(ft_proxy_list); |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
406 | } |
|
8169bfe82e47
Use Service Discovery to look up information about the manually specified FT
Daniel Atallah <datallah@pidgin.im>
parents:
21688
diff
changeset
|
407 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
408 | } |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
409 | |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
410 | struct _disco_data { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
411 | PurpleDiscoList *list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
412 | PurpleDiscoService *parent; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
413 | char *node; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
414 | }; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
415 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
416 | static void |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
417 | jabber_disco_server_info_result_cb(JabberStream *js, xmlnode *packet, gpointer data) |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
418 | { |
| 17421 | 419 | xmlnode *query, *child; |
| 15197 | 420 | const char *from = xmlnode_get_attrib(packet, "from"); |
| 421 | const char *type = xmlnode_get_attrib(packet, "type"); | |
| 422 | ||
|
15358
c8179e0a5483
[gaim-migrate @ 18087]
Evan Schoenberg <evands@pidgin.im>
parents:
15355
diff
changeset
|
423 | if((!from || !type) || |
|
c8179e0a5483
[gaim-migrate @ 18087]
Evan Schoenberg <evands@pidgin.im>
parents:
15355
diff
changeset
|
424 | (strcmp(from, js->user->domain))) { |
|
c8179e0a5483
[gaim-migrate @ 18087]
Evan Schoenberg <evands@pidgin.im>
parents:
15355
diff
changeset
|
425 | jabber_disco_finish_server_info_result_cb(js); |
| 15197 | 426 | return; |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
427 | } |
| 15197 | 428 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
429 | if(strcmp(type, "result")) { |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
430 | /* A common way to get here is for the server not to support xmlns http://jabber.org/protocol/disco#info */ |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
431 | jabber_disco_finish_server_info_result_cb(js); |
| 15197 | 432 | return; |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
433 | } |
| 15197 | 434 | |
| 435 | query = xmlnode_get_child(packet, "query"); | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
436 | |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
437 | if (!query) { |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
438 | jabber_disco_finish_server_info_result_cb(js); |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
439 | return; |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
440 | } |
|
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
441 | |
| 17421 | 442 | for (child = xmlnode_get_child(query, "identity"); child; |
| 15197 | 443 | child = xmlnode_get_next_twin(child)) { |
| 444 | const char *category, *type, *name; | |
| 445 | category = xmlnode_get_attrib(child, "category"); | |
|
17768
7be011945a1b
added preliminary frame for pep-support
Andreas Monitzer <am@adiumx.com>
parents:
17423
diff
changeset
|
446 | type = xmlnode_get_attrib(child, "type"); |
|
19894
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
447 | if(category && type && !strcmp(category, "pubsub") && !strcmp(type,"pep")) |
|
b273d0db2bdd
Fixed code indenting, some spaces were still left and now replaced by tabs.
Andreas Monitzer <am@adiumx.com>
parents:
18719
diff
changeset
|
448 | js->pep = TRUE; |
| 15197 | 449 | if (!category || strcmp(category, "server")) |
| 450 | continue; | |
| 451 | if (!type || strcmp(type, "im")) | |
| 452 | continue; | |
| 17421 | 453 | |
| 15197 | 454 | name = xmlnode_get_attrib(child, "name"); |
| 455 | if (!name) | |
| 456 | continue; | |
| 457 | ||
| 458 | g_free(js->server_name); | |
| 459 | js->server_name = g_strdup(name); | |
|
15587
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
460 | if (!strcmp(name, "Google Talk")) { |
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
461 | purple_debug_info("jabber", "Google Talk!\n"); |
|
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
462 | js->googletalk = TRUE; |
|
15587
cbedd543bfae
Google Talk uses structured text formatting where *this* is bold
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
463 | } |
| 15197 | 464 | } |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
465 | |
| 17421 | 466 | for (child = xmlnode_get_child(query, "feature"); child; |
| 15225 | 467 | child = xmlnode_get_next_twin(child)) { |
| 468 | const char *var; | |
| 469 | var = xmlnode_get_attrib(child, "var"); | |
| 470 | if (!var) | |
| 471 | continue; | |
| 472 | ||
| 473 | if (!strcmp("google:mail:notify", var)) { | |
| 474 | js->server_caps |= JABBER_CAP_GMAIL_NOTIFY; | |
| 475 | jabber_gmail_init(js); | |
| 15265 | 476 | } else if (!strcmp("google:roster", var)) { |
| 477 | js->server_caps |= JABBER_CAP_GOOGLE_ROSTER; | |
| 478 | jabber_google_roster_init(js); | |
|
17817
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
479 | } else if (!strcmp("http://jabber.org/protocol/commands", var)) { |
|
8e0f271aab78
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 <am@adiumx.com>
parents:
17816
diff
changeset
|
480 | js->server_caps |= JABBER_CAP_ADHOC; |
|
25290
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
481 | } else if (!strcmp("urn:xmpp:blocking", var)) { |
|
033942580f51
Commit patch #7670: Implement xep-0191 (simple blocking) for jabber protocols
Mark Doliner <markdoliner@pidgin.im>
parents:
23912
diff
changeset
|
482 | js->server_caps |= JABBER_CAP_BLOCKING; |
| 15225 | 483 | } |
| 484 | } | |
| 15265 | 485 | |
|
15355
1ce281d16071
[gaim-migrate @ 18084]
Evan Schoenberg <evands@pidgin.im>
parents:
15344
diff
changeset
|
486 | jabber_disco_finish_server_info_result_cb(js); |
| 15197 | 487 | } |
| 488 | ||
| 489 | static void | |
| 490 | jabber_disco_server_items_result_cb(JabberStream *js, xmlnode *packet, gpointer data) | |
| 8312 | 491 | { |
| 492 | xmlnode *query, *child; | |
| 493 | const char *from = xmlnode_get_attrib(packet, "from"); | |
| 494 | const char *type = xmlnode_get_attrib(packet, "type"); | |
| 495 | ||
| 496 | if(!from || !type) | |
| 497 | return; | |
| 498 | ||
| 499 | if(strcmp(from, js->user->domain)) | |
| 500 | return; | |
| 501 | ||
| 502 | if(strcmp(type, "result")) | |
| 503 | return; | |
| 504 | ||
| 505 | while(js->chat_servers) { | |
| 506 | g_free(js->chat_servers->data); | |
| 507 | js->chat_servers = g_list_delete_link(js->chat_servers, js->chat_servers); | |
| 508 | } | |
| 509 | ||
| 510 | query = xmlnode_get_child(packet, "query"); | |
| 511 | ||
| 512 | for(child = xmlnode_get_child(query, "item"); child; | |
| 513 | child = xmlnode_get_next_twin(child)) { | |
| 514 | JabberIq *iq; | |
|
17423
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
515 | const char *jid, *node; |
| 8312 | 516 | |
| 517 | if(!(jid = xmlnode_get_attrib(child, "jid"))) | |
| 518 | continue; | |
| 519 | ||
|
17423
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
520 | /* we don't actually care about the specific nodes, |
|
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
521 | * so we won't query them */ |
|
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
522 | if((node = xmlnode_get_attrib(child, "node"))) |
|
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
523 | continue; |
|
1f3a88fda48e
skip some unneeded queries that we don't particularly need or want
Nathan Walp <nwalp@pidgin.im>
parents:
17421
diff
changeset
|
524 | |
| 8312 | 525 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
| 526 | xmlnode_set_attrib(iq->node, "to", jid); | |
| 527 | jabber_iq_send(iq); | |
| 528 | } | |
| 529 | } | |
| 530 | ||
| 531 | void jabber_disco_items_server(JabberStream *js) | |
| 532 | { | |
| 533 | JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_GET, | |
| 534 | "http://jabber.org/protocol/disco#items"); | |
| 535 | ||
| 536 | xmlnode_set_attrib(iq->node, "to", js->user->domain); | |
| 537 | ||
| 15197 | 538 | jabber_iq_set_callback(iq, jabber_disco_server_items_result_cb, NULL); |
| 539 | jabber_iq_send(iq); | |
| 540 | ||
|
21688
a16385b34219
Implement more of XEP-0065 to support sending files through a proxy. To avoid adding strings this close to a release, it only supports using a proxy that is discovered from the server, but we'll include an account option to manually specify a ft proxy in the next release. Lots of this is based on a patch from galt - Fixes #3730, #116, #1768
Daniel Atallah <datallah@pidgin.im>
parents:
19897
diff
changeset
|
541 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
| 15197 | 542 | xmlnode_set_attrib(iq->node, "to", js->user->domain); |
| 543 | jabber_iq_set_callback(iq, jabber_disco_server_info_result_cb, NULL); | |
| 8312 | 544 | jabber_iq_send(iq); |
| 545 | } | |
| 546 | ||
| 547 | void jabber_disco_info_do(JabberStream *js, const char *who, JabberDiscoInfoCallback *callback, gpointer data) | |
| 548 | { | |
| 549 | JabberID *jid; | |
| 550 | JabberBuddy *jb; | |
| 551 | JabberBuddyResource *jbr = NULL; | |
| 552 | struct _jabber_disco_info_cb_data *jdicd; | |
| 553 | JabberIq *iq; | |
| 554 | ||
| 555 | if((jid = jabber_id_new(who))) { | |
| 556 | if(jid->resource && (jb = jabber_buddy_find(js, who, TRUE))) | |
| 557 | jbr = jabber_buddy_find_resource(jb, jid->resource); | |
| 558 | jabber_id_free(jid); | |
| 559 | } | |
| 560 | ||
| 561 | if(jbr && jbr->capabilities & JABBER_CAP_RETRIEVED) { | |
| 562 | callback(js, who, jbr->capabilities, data); | |
| 563 | return; | |
| 564 | } | |
| 565 | ||
| 566 | jdicd = g_new0(struct _jabber_disco_info_cb_data, 1); | |
| 567 | jdicd->data = data; | |
| 568 | jdicd->callback = callback; | |
| 569 | ||
| 570 | g_hash_table_insert(js->disco_callbacks, g_strdup(who), jdicd); | |
| 571 | ||
| 572 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); | |
| 573 | xmlnode_set_attrib(iq->node, "to", who); | |
| 574 | ||
| 575 | jabber_iq_send(iq); | |
| 576 | } | |
| 577 | ||
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
578 | static void |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
579 | jabber_disco_list_data_destroy(struct jabber_disco_list_data *data) |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
580 | { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
581 | g_return_if_fail(data != NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
582 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
583 | g_free(data->server); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
584 | g_free(data); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
585 | } |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
586 | |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
587 | static PurpleDiscoServiceCategory |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
588 | jabber_disco_category_from_string(const gchar *str) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
589 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
590 | if (!strcasecmp(str, "gateway")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
591 | return PURPLE_DISCO_SERVICE_CAT_GATEWAY; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
592 | else if (!strcasecmp(str, "directory")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
593 | return PURPLE_DISCO_SERVICE_CAT_DIRECTORY; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
594 | else if (!strcasecmp(str, "conference")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
595 | return PURPLE_DISCO_SERVICE_CAT_MUC; |
| 8312 | 596 | |
|
26586
32f62e0864ad
Fix compilation errors and add padding to UI ops. My bad...
Paul Aurich <darkrain42@pidgin.im>
parents:
26584
diff
changeset
|
597 | return PURPLE_DISCO_SERVICE_CAT_OTHER; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
598 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
599 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
600 | static PurpleDiscoServiceType |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
601 | jabber_disco_type_from_string(const gchar *str) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
602 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
603 | if (!strcasecmp(str, "xmpp")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
604 | return PURPLE_DISCO_SERVICE_TYPE_XMPP; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
605 | else if (!strcasecmp(str, "icq")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
606 | return PURPLE_DISCO_SERVICE_TYPE_ICQ; |
|
26584
15b6fba6b2f7
'mrim' is the mail.ru IM service. 'smtp' is an XMPP<>email gateway
Paul Aurich <darkrain42@pidgin.im>
parents:
26583
diff
changeset
|
607 | else if (!strcasecmp(str, "smtp")) |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
608 | return PURPLE_DISCO_SERVICE_TYPE_MAIL; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
609 | else if (!strcasecmp(str, "user")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
610 | return PURPLE_DISCO_SERVICE_TYPE_USER; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
611 | else if (!strcasecmp(str, "yahoo")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
612 | return PURPLE_DISCO_SERVICE_TYPE_YAHOO; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
613 | else if (!strcasecmp(str, "irc")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
614 | return PURPLE_DISCO_SERVICE_TYPE_IRC; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
615 | else if (!strcasecmp(str, "gadu-gadu")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
616 | return PURPLE_DISCO_SERVICE_TYPE_GG; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
617 | else if (!strcasecmp(str, "aim")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
618 | return PURPLE_DISCO_SERVICE_TYPE_AIM; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
619 | else if (!strcasecmp(str, "qq")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
620 | return PURPLE_DISCO_SERVICE_TYPE_QQ; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
621 | else if (!strcasecmp(str, "msn")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
622 | return PURPLE_DISCO_SERVICE_TYPE_MSN; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
623 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
624 | return PURPLE_DISCO_SERVICE_TYPE_NONE; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
625 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
626 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
627 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
628 | jabber_disco_service_info_cb(JabberStream *js, xmlnode *packet, gpointer data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
629 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
630 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
631 | jabber_disco_service_items_cb(JabberStream *js, xmlnode *packet, gpointer data) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
632 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
633 | struct _disco_data *disco_data = data; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
634 | struct jabber_disco_list_data *list_data; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
635 | PurpleDiscoList *list = disco_data->list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
636 | PurpleDiscoService *parent = disco_data->parent; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
637 | const char *parent_node = disco_data->node; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
638 | xmlnode *query = xmlnode_get_child(packet, "query"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
639 | const char *from = xmlnode_get_attrib(packet, "from"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
640 | const char *result = xmlnode_get_attrib(packet, "type"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
641 | xmlnode *child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
642 | gboolean has_items = FALSE; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
643 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
644 | list_data = purple_disco_list_get_protocol_data(list); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
645 | --list_data->fetch_count; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
646 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
647 | if (!from || !result || !query || strcmp(result, "result") != 0) { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
648 | if (list_data->fetch_count == 0) { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
649 | jabber_disco_list_data_destroy(list_data); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
650 | purple_disco_list_set_protocol_data(list, NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
651 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
652 | purple_disco_list_set_in_progress(list, FALSE); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
653 | } |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
654 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
655 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
656 | return; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
657 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
658 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
659 | query = xmlnode_get_child(packet, "query"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
660 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
661 | for(child = xmlnode_get_child(query, "item"); child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
662 | child = xmlnode_get_next_twin(child)) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
663 | JabberIq *iq; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
664 | xmlnode *q; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
665 | const char *jid, *node; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
666 | struct _disco_data *disco_data; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
667 | char *full_node; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
668 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
669 | if(!(jid = xmlnode_get_attrib(child, "jid")) || !purple_disco_list_get_protocol_data(list)) |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
670 | continue; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
671 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
672 | node = xmlnode_get_attrib(child, "node"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
673 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
674 | if (parent_node) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
675 | if (node) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
676 | full_node = g_new0(char, strlen(parent_node) + 1 + strlen(node) + 1); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
677 | strcat(full_node, parent_node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
678 | strcat(full_node, "/"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
679 | strcat(full_node, node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
680 | } else { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
681 | continue; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
682 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
683 | } else { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
684 | full_node = g_strdup(node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
685 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
686 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
687 | disco_data = g_new0(struct _disco_data, 1); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
688 | disco_data->list = list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
689 | disco_data->parent = parent; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
690 | disco_data->node = full_node; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
691 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
692 | has_items = TRUE; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
693 | ++list_data->fetch_count; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
694 | purple_disco_list_ref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
695 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
696 | xmlnode_set_attrib(iq->node, "to", jid); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
697 | if (full_node && (q = xmlnode_get_child(iq->node, "query"))) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
698 | xmlnode_set_attrib(q, "node", full_node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
699 | jabber_iq_set_callback(iq, jabber_disco_service_info_cb, disco_data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
700 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
701 | jabber_iq_send(iq); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
702 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
703 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
704 | if (list_data->fetch_count == 0) { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
705 | jabber_disco_list_data_destroy(list_data); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
706 | purple_disco_list_set_protocol_data(list, NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
707 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
708 | purple_disco_list_set_in_progress(list, FALSE); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
709 | } |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
710 | |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
711 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
712 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
713 | g_free(disco_data->node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
714 | g_free(disco_data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
715 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
716 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
717 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
718 | jabber_disco_service_info_cb(JabberStream *js, xmlnode *packet, gpointer data) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
719 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
720 | struct _disco_data *disco_data = data; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
721 | struct jabber_disco_list_data *list_data; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
722 | PurpleDiscoList *list = disco_data->list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
723 | PurpleDiscoService *parent = disco_data->parent; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
724 | char *node = g_strdup(disco_data->node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
725 | xmlnode *query, *ident, *child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
726 | const char *from = xmlnode_get_attrib(packet, "from"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
727 | const char *result = xmlnode_get_attrib(packet, "type"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
728 | const char *acat, *atype, *adesc, *anode; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
729 | char *aname; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
730 | PurpleDiscoService *s; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
731 | PurpleDiscoServiceCategory cat; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
732 | PurpleDiscoServiceType type; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
733 | PurpleDiscoServiceFlags flags = PURPLE_DISCO_ADD; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
734 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
735 | g_free(disco_data->node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
736 | g_free(disco_data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
737 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
738 | list_data = purple_disco_list_get_protocol_data(list); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
739 | --list_data->fetch_count; |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
740 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
741 | if (!from || !result || strcmp(result, "result") != 0 |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
742 | || (!(query = xmlnode_get_child(packet, "query"))) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
743 | || (!(ident = xmlnode_get_child(query, "identity")))) { |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
744 | if (list_data->fetch_count == 0) { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
745 | jabber_disco_list_data_destroy(list_data); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
746 | purple_disco_list_set_protocol_data(list, NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
747 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
748 | purple_disco_list_set_in_progress(list, FALSE); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
749 | } |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
750 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
751 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
752 | return; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
753 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
754 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
755 | acat = xmlnode_get_attrib(ident, "category"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
756 | atype = xmlnode_get_attrib(ident, "type"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
757 | adesc = xmlnode_get_attrib(ident, "name"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
758 | anode = xmlnode_get_attrib(query, "node"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
759 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
760 | if (anode) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
761 | aname = g_new0(char, strlen(from) + strlen(anode) + 1); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
762 | strcat(aname, from); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
763 | strcat(aname, anode); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
764 | } else { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
765 | aname = g_strdup(from); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
766 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
767 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
768 | cat = jabber_disco_category_from_string(acat); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
769 | type = jabber_disco_type_from_string(atype); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
770 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
771 | for (child = xmlnode_get_child(query, "feature"); child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
772 | child = xmlnode_get_next_twin(child)) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
773 | const char *var; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
774 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
775 | if (!(var = xmlnode_get_attrib(child, "var"))) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
776 | continue; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
777 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
778 | if (!strcmp(var, "jabber:iq:register")) |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
779 | flags |= PURPLE_DISCO_REGISTER; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
780 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
781 | if (!strcmp(var, "http://jabber.org/protocol/disco#items")) |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
782 | flags |= PURPLE_DISCO_BROWSE; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
783 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
784 | if (!strcmp(var, "http://jabber.org/protocol/muc")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
785 | cat = PURPLE_DISCO_SERVICE_CAT_MUC; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
786 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
787 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
788 | purple_debug_info("disco", "service %s, category %s (%d), type %s (%d), description %s, flags %04x\n", |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
789 | aname, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
790 | acat, cat, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
791 | atype, type, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
792 | adesc, flags); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
793 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
794 | s = purple_disco_list_service_new(cat, aname, type, adesc, flags); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
795 | purple_disco_list_service_add(list, s, parent); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
796 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
797 | /* if (flags & PURPLE_DISCO_FLAG_BROWSE) - not all browsable services has this future */ |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
798 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
799 | xmlnode *q; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
800 | JabberIq *iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
801 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
802 | ++list_data->fetch_count; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
803 | purple_disco_list_ref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
804 | disco_data = g_new0(struct _disco_data, 1); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
805 | disco_data->list = list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
806 | disco_data->parent = s; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
807 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
808 | xmlnode_set_attrib(iq->node, "to", from); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
809 | jabber_iq_set_callback(iq, jabber_disco_service_items_cb, disco_data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
810 | if (anode && (q = xmlnode_get_child(iq->node, "query"))) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
811 | xmlnode_set_attrib(q, "node", node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
812 | jabber_iq_send(iq); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
813 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
814 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
815 | if (list_data->fetch_count == 0) { |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
816 | jabber_disco_list_data_destroy(list_data); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
817 | purple_disco_list_set_protocol_data(list, NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
818 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
819 | purple_disco_list_set_in_progress(list, FALSE); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
820 | } |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
821 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
822 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
823 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
824 | g_free(aname); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
825 | g_free(node); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
826 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
827 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
828 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
829 | jabber_disco_server_items_cb(JabberStream *js, xmlnode *packet, gpointer data) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
830 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
831 | PurpleDiscoList *list = data; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
832 | struct jabber_disco_list_data *list_data; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
833 | xmlnode *query, *child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
834 | const char *from = xmlnode_get_attrib(packet, "from"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
835 | const char *type = xmlnode_get_attrib(packet, "type"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
836 | gboolean has_items = FALSE; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
837 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
838 | if (!from || !type) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
839 | return; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
840 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
841 | if (strcmp(type, "result")) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
842 | return; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
843 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
844 | list_data = purple_disco_list_get_protocol_data(list); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
845 | |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
846 | query = xmlnode_get_child(packet, "query"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
847 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
848 | for(child = xmlnode_get_child(query, "item"); child; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
849 | child = xmlnode_get_next_twin(child)) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
850 | JabberIq *iq; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
851 | const char *jid; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
852 | struct _disco_data *disco_data; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
853 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
854 | if(!(jid = xmlnode_get_attrib(child, "jid")) || !purple_disco_list_get_protocol_data(list)) |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
855 | continue; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
856 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
857 | disco_data = g_new0(struct _disco_data, 1); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
858 | disco_data->list = list; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
859 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
860 | has_items = TRUE; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
861 | ++list_data->fetch_count; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
862 | purple_disco_list_ref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
863 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#info"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
864 | xmlnode_set_attrib(iq->node, "to", jid); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
865 | jabber_iq_set_callback(iq, jabber_disco_service_info_cb, disco_data); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
866 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
867 | jabber_iq_send(iq); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
868 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
869 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
870 | if (!has_items) |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
871 | purple_disco_list_set_in_progress(list, FALSE); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
872 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
873 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
874 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
875 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
876 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
877 | jabber_disco_server_info_cb(JabberStream *js, const char *who, JabberCapabilities caps, gpointer data) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
878 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
879 | PurpleDiscoList *list = data; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
880 | JabberIq *iq; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
881 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
882 | if (caps & JABBER_CAP_ITEMS) { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
883 | iq = jabber_iq_new_query(js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
884 | xmlnode_set_attrib(iq->node, "to", who); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
885 | jabber_iq_set_callback(iq, jabber_disco_server_items_cb, list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
886 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
887 | if (purple_disco_list_get_protocol_data(list)) |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
888 | jabber_iq_send(iq); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
889 | else |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
890 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
891 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
892 | } else { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
893 | purple_notify_error(NULL, _("Error"), _("Server doesn't support service discovery"), NULL); |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
894 | purple_disco_list_set_in_progress(list, FALSE); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
895 | purple_disco_list_unref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
896 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
897 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
898 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
899 | static void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
900 | jabber_disco_server_cb(PurpleDiscoList *list, PurpleRequestFields *fields) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
901 | { |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
902 | PurpleAccount *account; |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
903 | PurpleConnection *gc; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
904 | JabberStream *js; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
905 | const char *server_name; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
906 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
907 | server_name = purple_request_fields_get_string(fields, "server"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
908 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
909 | account = purple_disco_list_get_account(list); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
910 | gc = purple_account_get_connection(account); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
911 | if (!gc) |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
912 | return; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
913 | js = purple_connection_get_protocol_data(gc); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
914 | |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
915 | purple_disco_list_set_in_progress(list, TRUE); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
916 | purple_debug_misc("jabber", "Service discovery for %s\n", server_name); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
917 | if (js->last_disco_server) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
918 | g_free(js->last_disco_server); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
919 | js->last_disco_server = g_strdup(server_name); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
920 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
921 | jabber_disco_info_do(js, server_name, jabber_disco_server_info_cb, list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
922 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
923 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
924 | void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
925 | jabber_disco_get_list(PurpleConnection *gc, PurpleDiscoList *list) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
926 | { |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
927 | PurpleRequestFields *fields; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
928 | PurpleRequestFieldGroup *g; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
929 | PurpleRequestField *f; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
930 | JabberStream *js; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
931 | struct jabber_disco_list_data *disco_list_data; |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
932 | const char *last_server; |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
933 | |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
934 | purple_debug_misc("disco.c", "get_list\n"); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
935 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
936 | js = purple_connection_get_protocol_data(gc); |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
937 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
938 | disco_list_data = g_new0(struct jabber_disco_list_data, 1); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
939 | purple_disco_list_set_protocol_data(list, disco_list_data); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
940 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
941 | last_server = js->last_disco_server; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
942 | if (last_server == NULL) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
943 | last_server = js->user->domain; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
944 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
945 | fields = purple_request_fields_new(); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
946 | g = purple_request_field_group_new(NULL); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
947 | f = purple_request_field_string_new("server", _("Server"), |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
948 | last_server ? last_server : js->user->domain, FALSE); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
949 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
950 | purple_request_field_group_add_field(g, f); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
951 | purple_request_fields_add_group(fields, g); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
952 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
953 | purple_disco_list_ref(list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
954 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
955 | purple_request_fields(gc, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
956 | _("Server name request"), |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
957 | _("Enter server name"), |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
958 | NULL, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
959 | fields, |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
960 | _("OK"), G_CALLBACK(jabber_disco_server_cb), |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
961 | _("Cancel"), G_CALLBACK(jabber_disco_cancel), |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
962 | purple_connection_get_account(gc), NULL, NULL, list); |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
963 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
964 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
965 | void |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
966 | jabber_disco_cancel(PurpleDiscoList *list) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
967 | { |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
968 | jabber_disco_list_data_destroy(purple_disco_list_get_protocol_data(list)); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
969 | purple_disco_list_set_protocol_data(list, NULL); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
970 | purple_disco_list_set_in_progress(list, FALSE); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
971 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
972 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
973 | int |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
974 | jabber_disco_service_register(PurpleConnection *gc, PurpleDiscoService *service) |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
975 | { |
|
26588
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
976 | JabberStream *js = purple_connection_get_protocol_data(gc); |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
977 | |
|
644d7d7ad292
Hide the structs, add accessors, and fix various smaller things:
Paul Aurich <darkrain42@pidgin.im>
parents:
26586
diff
changeset
|
978 | jabber_register_gateway(js, purple_disco_service_get_name(service)); |
|
26583
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
979 | |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
980 | return 0; |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
981 | } |
|
e115c7ef2fcf
Applied disco-2.patch from nops with some modifications:
Paul Aurich <darkrain42@pidgin.im>
parents:
26042
diff
changeset
|
982 |