Mon, 28 Sep 2009 22:11:54 +0000
jabber: Don't crash when disconnecting if there's been no response from the server.
PurpleBOSHConnection.sid is only set after we've received a resposne from
the server, so if we try to send a 'terminate' before we have a response,
it will crash on Win32 (NULL printf), plus it's wrong anyway.
|
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:
diff
changeset
|
1 | /* |
|
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:
diff
changeset
|
2 | * purple - Jabber Protocol Plugin |
|
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:
diff
changeset
|
3 | * |
|
28322
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
28321
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too numerous |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
28321
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
ac8fec1d2234
Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents:
28321
diff
changeset
|
6 | * source distribution. |
|
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:
diff
changeset
|
7 | * |
|
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:
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
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:
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
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:
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
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:
diff
changeset
|
11 | * (at your option) any later version. |
|
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:
diff
changeset
|
12 | * |
|
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:
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
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:
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
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:
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
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:
diff
changeset
|
16 | * GNU General Public License for more details. |
|
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:
diff
changeset
|
17 | * |
|
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:
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
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:
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
28321
c8d617c408ab
Update various header copyrights thanks to licensecheck.
Paul Aurich <darkrain42@pidgin.im>
parents:
27068
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
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:
diff
changeset
|
21 | * |
|
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:
diff
changeset
|
22 | */ |
|
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:
diff
changeset
|
23 | |
|
26703
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
17816
diff
changeset
|
24 | #ifndef PURPLE_JABBER_CAPS_H_ |
|
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
17816
diff
changeset
|
25 | #define PURPLE_JABBER_CAPS_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:
diff
changeset
|
26 | |
|
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:
diff
changeset
|
27 | typedef struct _JabberCapsClientInfo JabberCapsClientInfo; |
|
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:
diff
changeset
|
28 | |
|
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:
diff
changeset
|
29 | #include "jabber.h" |
|
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:
diff
changeset
|
30 | |
|
24736
42ffd8ecdb6e
Make capstable caps.c-only and add a jabber_caps_uninit() function
Paul Aurich <darkrain42@pidgin.im>
parents:
24732
diff
changeset
|
31 | /* Implementation of XEP-0115 - Entity Capabilities */ |
|
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:
diff
changeset
|
32 | |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
33 | typedef struct _JabberCapsNodeExts JabberCapsNodeExts; |
|
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:
diff
changeset
|
34 | |
|
27067
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
35 | typedef struct _JabberCapsTuple { |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
36 | const char *node; |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
37 | const char *ver; |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
38 | const char *hash; |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
39 | } JabberCapsTuple; |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
40 | |
|
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:
diff
changeset
|
41 | struct _JabberCapsClientInfo { |
|
24724
54e94c5f6978
Remove JabberCapsIdentity and just use JabberIdentity everywhere
Paul Aurich <darkrain42@pidgin.im>
parents:
24721
diff
changeset
|
42 | GList *identities; /* JabberIdentity */ |
|
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:
diff
changeset
|
43 | GList *features; /* char * */ |
|
23587
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
44 | GList *forms; /* xmlnode * */ |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
45 | JabberCapsNodeExts *exts; |
|
27067
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
46 | |
|
fa8eb96a2544
Make the JabberCapsTuple (nee Key) available to the rest of the prpl
Paul Aurich <darkrain42@pidgin.im>
parents:
26707
diff
changeset
|
47 | const JabberCapsTuple tuple; |
|
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:
diff
changeset
|
48 | }; |
|
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:
diff
changeset
|
49 | |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
50 | /* |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
51 | * This stores a set of exts "known" for a specific node (which indicates |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
52 | * a specific client -- for reference, Pidgin, Finch, Meebo, et al share one |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
53 | * node.) In XEP-0115 v1.3, exts are used for features that may or may not be |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
54 | * present at a given time (PEP things, buzz might be disabled, etc). |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
55 | * |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
56 | * This structure is shared among all JabberCapsClientInfo instances matching |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
57 | * a specific node (if the capstable key->hash == NULL, which indicates that |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
58 | * the ClientInfo is using v1.3 caps as opposed to v1.5 caps). |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
59 | * |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
60 | * It's only exposed so that jabber_resource_has_capability can use it. |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
61 | * Everyone else, STAY AWAY! |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
62 | */ |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
63 | struct _JabberCapsNodeExts { |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
64 | guint ref; |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
65 | GHashTable *exts; /* char *ext_name -> GList *features */ |
|
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:
diff
changeset
|
66 | }; |
|
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:
diff
changeset
|
67 | |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
68 | typedef void (*jabber_caps_get_info_cb)(JabberCapsClientInfo *info, GList *exts, gpointer user_data); |
|
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:
diff
changeset
|
69 | |
|
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:
diff
changeset
|
70 | void jabber_caps_init(void); |
|
24736
42ffd8ecdb6e
Make capstable caps.c-only and add a jabber_caps_uninit() function
Paul Aurich <darkrain42@pidgin.im>
parents:
24732
diff
changeset
|
71 | void jabber_caps_uninit(void); |
|
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:
diff
changeset
|
72 | |
|
27068
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
73 | /** |
|
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
74 | * Check whether all of the exts in a char* array are known to the given info. |
|
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
75 | */ |
|
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
76 | gboolean jabber_caps_exts_known(const JabberCapsClientInfo *info, char **exts); |
|
23596
164fbee281c1
* fixing a bug in jabber_caps_compare()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23594
diff
changeset
|
77 | |
|
23591
ba1e3ed78d40
* pass hash type to the caps handling functions
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23590
diff
changeset
|
78 | /** |
|
24878
19969457944c
Reference-count JabberCapsClientInfo and fix bug.
Paul Aurich <darkrain42@pidgin.im>
parents:
24736
diff
changeset
|
79 | * Main entity capabilites function to get the capabilities of a contact. |
|
19969457944c
Reference-count JabberCapsClientInfo and fix bug.
Paul Aurich <darkrain42@pidgin.im>
parents:
24736
diff
changeset
|
80 | * |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
81 | * The callback will be called synchronously if we already have the |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
82 | * capabilities for the specified (node,ver,hash) (and, if exts are specified, |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
83 | * if we know what each means) |
|
27068
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
84 | * |
|
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
85 | * @param exts A g_strsplit'd (NULL-terminated) array of strings. This |
|
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
86 | * function is responsible for freeing it. |
|
23591
ba1e3ed78d40
* pass hash type to the caps handling functions
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23590
diff
changeset
|
87 | */ |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
88 | void jabber_caps_get_info(JabberStream *js, const char *who, const char *node, |
|
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
89 | const char *ver, const char *hash, |
|
27068
3353c0f46a1a
Only call jabber_caps_get_info if we don't have all the information we want.
Paul Aurich <darkrain42@pidgin.im>
parents:
27067
diff
changeset
|
90 | char **exts, jabber_caps_get_info_cb cb, |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
91 | gpointer user_data); |
|
23586
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
92 | |
|
23587
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
93 | /** |
|
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
94 | * Takes a JabberCapsClientInfo pointer and returns the caps hash according to |
|
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
95 | * XEP-0115 Version 1.5. |
|
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
96 | * |
|
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
97 | * @param info A JabberCapsClientInfo pointer. |
|
23593
149bce500f4e
* support for calculating both hashes, sha-1 and md5
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23591
diff
changeset
|
98 | * @param hash Hash cipher to be used. Either sha-1 or md5. |
|
24880
ae4e8598d0bf
Support old (XEP v1.3) Entity Capabilities alongside the new ones.
Paul Aurich <darkrain42@pidgin.im>
parents:
24878
diff
changeset
|
99 | * @return The base64 encoded SHA-1 hash; must be freed by caller |
|
23587
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
100 | */ |
|
24715
69aaae59e205
Fix compilation errors and many warnings
Paul Aurich <darkrain42@pidgin.im>
parents:
23622
diff
changeset
|
101 | gchar *jabber_caps_calculate_hash(JabberCapsClientInfo *info, const char *hash); |
|
23587
1691c5361029
* changed name of jabber_caps_calculate_hash() to jabber_caps_calculate_own_hash()
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23586
diff
changeset
|
102 | |
|
23622
1cadf80e85ae
* adding some missing documentation
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23601
diff
changeset
|
103 | /** |
|
24715
69aaae59e205
Fix compilation errors and many warnings
Paul Aurich <darkrain42@pidgin.im>
parents:
23622
diff
changeset
|
104 | * Calculate SHA1 hash for own featureset. |
|
23622
1cadf80e85ae
* adding some missing documentation
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23601
diff
changeset
|
105 | */ |
|
24715
69aaae59e205
Fix compilation errors and many warnings
Paul Aurich <darkrain42@pidgin.im>
parents:
23622
diff
changeset
|
106 | void jabber_caps_calculate_own_hash(JabberStream *js); |
|
23586
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
107 | |
|
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
108 | /** Get the current caps hash. |
|
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
109 | * @ret hash |
|
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
110 | **/ |
|
24716
047f5075ca58
Entity Capabilities must be per-JabberStream
Paul Aurich <darkrain42@pidgin.im>
parents:
24715
diff
changeset
|
111 | const gchar* jabber_caps_get_own_hash(JabberStream *js); |
|
23586
e495a4623f76
Removing short-names for features and calculating own caps hash.
Tobias Markmann <tfar@soc.pidgin.im>
parents:
17816
diff
changeset
|
112 | |
|
23601
f7e44345f4b9
* implemented jabber_caps_broadcast_change() and finished jabber_ipc_add_feature() IPC function
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23597
diff
changeset
|
113 | /** |
|
23622
1cadf80e85ae
* adding some missing documentation
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23601
diff
changeset
|
114 | * Broadcast a new calculated hash using a <presence> stanza. |
|
23601
f7e44345f4b9
* implemented jabber_caps_broadcast_change() and finished jabber_ipc_add_feature() IPC function
Tobias Markmann <tfar@soc.pidgin.im>
parents:
23597
diff
changeset
|
115 | */ |
|
24715
69aaae59e205
Fix compilation errors and many warnings
Paul Aurich <darkrain42@pidgin.im>
parents:
23622
diff
changeset
|
116 | void jabber_caps_broadcast_change(void); |
|
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:
diff
changeset
|
117 | |
|
26703
17f9a4bef2a3
Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents:
17816
diff
changeset
|
118 | #endif /* PURPLE_JABBER_CAPS_H_ */ |