libpurple/protocols/jabber/jutil.h

Sat, 17 Oct 2009 00:37:04 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Sat, 17 Oct 2009 00:37:04 +0000
changeset 28703
521344e75710
parent 28431
8450418b5abd
child 29027
6af29b140195
child 29063
f245c5e9e9f3
permissions
-rw-r--r--

jabber: Improved support for XEP-0249 (and document the legacy stuff).

Ironically, I don't think there's a way to invoke the code in chat.c as-is,
since it's specifically invoked if the server doesn't purport to be a MUC.

7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
1 /**
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
2 * @file jutil.h utility functions
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
3 *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
4 * purple
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
5 *
28322
ac8fec1d2234 Remove specific copyright lines from the XMPP prpl.
Paul Aurich <darkrain42@pidgin.im>
parents: 27898
diff changeset
6 * 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: 27898
diff changeset
7 * 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: 27898
diff changeset
8 * source distribution.
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
9 *
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
10 * This program is free software; you can redistribute it and/or modify
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
11 * it under the terms of the GNU General Public License as published by
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
13 * (at your option) any later version.
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
14 *
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
18 * GNU General Public License for more details.
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
19 *
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
21 * 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: 15952
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
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: 25110
diff changeset
24 #ifndef PURPLE_JABBER_JUTIL_H_
17f9a4bef2a3 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents: 25110
diff changeset
25 #define PURPLE_JABBER_JUTIL_H_
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
26
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
27 typedef struct _JabberID {
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
28 char *node;
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
29 char *domain;
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
30 char *resource;
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
31 } JabberID;
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
32
27480
7efe4b1ff6a0 I had to make these changes to get "make check" to run
Mark Doliner <markdoliner@pidgin.im>
parents: 27163
diff changeset
33 #include "jabber.h"
7efe4b1ff6a0 I had to make these changes to get "make check" to run
Mark Doliner <markdoliner@pidgin.im>
parents: 27163
diff changeset
34
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
35 JabberID* jabber_id_new(const char *str);
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
36 void jabber_id_free(JabberID *jid);
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
37
7306
61d7324411f8 [gaim-migrate @ 7890]
Nathan Walp <nwalp@pidgin.im>
parents: 7262
diff changeset
38 char *jabber_get_resource(const char *jid);
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
39 char *jabber_get_bare_jid(const char *jid);
28431
8450418b5abd jabber: Properly handle adding buddies that contain a resource. Closes #10151.
Paul Aurich <darkrain42@pidgin.im>
parents: 28322
diff changeset
40 char *jabber_id_get_bare_jid(const JabberID *jid);
7014
11471fae7ba0 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents:
diff changeset
41
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
42 const char *jabber_normalize(const PurpleAccount *account, const char *in);
7261
4be05820d441 [gaim-migrate @ 7838]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
43
27163
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
44 /* Returns true if JID is the bare JID of our server. */
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
45 gboolean jabber_is_own_server(JabberStream *js, const char *jid);
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
46
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
47 /* Returns true if JID is the bare JID of our account. */
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
48 gboolean jabber_is_own_account(JabberStream *js, const char *jid);
398d47149e2f Add two helper functions useful for matching the 'from' attribute on packets to either our server or our account.
Paul Aurich <darkrain42@pidgin.im>
parents: 26703
diff changeset
49
7310
1346a99cba40 [gaim-migrate @ 7894]
Nathan Walp <nwalp@pidgin.im>
parents: 7306
diff changeset
50 gboolean jabber_nodeprep_validate(const char *);
27728
03b2a20ba465 Validate IPv6 identifiers in the domain portion of a JID.
Paul Aurich <darkrain42@pidgin.im>
parents: 27723
diff changeset
51 gboolean jabber_domain_validate(const char *);
7310
1346a99cba40 [gaim-migrate @ 7894]
Nathan Walp <nwalp@pidgin.im>
parents: 7306
diff changeset
52 gboolean jabber_resourceprep_validate(const char *);
1346a99cba40 [gaim-migrate @ 7894]
Nathan Walp <nwalp@pidgin.im>
parents: 7306
diff changeset
53
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15435
diff changeset
54 PurpleConversation *jabber_find_unnormalized_conv(const char *name, PurpleAccount *account);
8043
86a087e9624c [gaim-migrate @ 8727]
Nathan Walp <nwalp@pidgin.im>
parents: 7395
diff changeset
55
25110
40b3fffdb00b Fix up the XMPP User Avatar SHA1 hashing so that we don't mess up the checksum
Paul Aurich <darkrain42@pidgin.im>
parents: 20179
diff changeset
56 char *jabber_calculate_data_sha1sum(gconstpointer data, size_t len);
26703
17f9a4bef2a3 Further standardize the sentinel style (did someone say leading _s are theoretically a reserved namespace?)
Paul Aurich <darkrain42@pidgin.im>
parents: 25110
diff changeset
57 #endif /* PURPLE_JABBER_JUTIL_H_ */

mercurial