annotate src/protocols/jabber/jabber.h @ 11533:c9b815aeddc1

[gaim-migrate @ 13782] Pushing more of the userinfo stuff to the UI. Also, fixed a notify API warning in the perl plugin. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Mon, 12 Sep 2005 20:04:37 +0000
parents 1e756e251dc3
children 828802f2251b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
1 /**
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
2 * @file jabber.h
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
3 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
4 * gaim
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
5 *
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com>
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
7 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
8 * This program is free software; you can redistribute it and/or modify
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
9 * it under the terms of the GNU General Public License as published by
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
10 * the Free Software Foundation; either version 2 of the License, or
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
11 * (at your option) any later version.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
12 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
13 * This program is distributed in the hope that it will be useful,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
16 * GNU General Public License for more details.
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
17 *
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
18 * You should have received a copy of the GNU General Public License
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
19 * along with this program; if not, write to the Free Software
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
21 */
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
22 #ifndef _GAIM_JABBER_H_
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
23 #define _GAIM_JABBER_H_
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
24
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
25 #include <glib.h>
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
26 #include "connection.h"
8113
d60272410bd5 [gaim-migrate @ 8817]
Nathan Walp <nwalp@pidgin.im>
parents: 8043
diff changeset
27 #include "roomlist.h"
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
28 #include "sslconn.h"
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
29
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
30 #include "jutil.h"
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
31 #include "xmlnode.h"
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
32
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
33 typedef enum {
8312
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
34 JABBER_CAP_NONE = 0,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
35 JABBER_CAP_XHTML = 1 << 0,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
36 JABBER_CAP_COMPOSING = 1 << 1,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
37 JABBER_CAP_SI = 1 << 2,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
38 JABBER_CAP_SI_FILE_XFER = 1 << 3,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
39 JABBER_CAP_BYTESTREAMS = 1 << 4,
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
40 JABBER_CAP_IBB = 1 << 5,
11393
1e756e251dc3 [gaim-migrate @ 13623]
Nathan Walp <nwalp@pidgin.im>
parents: 10941
diff changeset
41 JABBER_CAP_CHAT_STATES = 1 << 6,
8312
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
42 JABBER_CAP_RETRIEVED = 1 << 31
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
43 } JabberCapabilities;
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
44
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
45 typedef enum {
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
46 JABBER_STREAM_OFFLINE,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
47 JABBER_STREAM_CONNECTING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
48 JABBER_STREAM_INITIALIZING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
49 JABBER_STREAM_AUTHENTICATING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
50 JABBER_STREAM_REINITIALIZING,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
51 JABBER_STREAM_CONNECTED
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
52 } JabberStreamState;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
53
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
54 typedef struct _JabberStream
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
55 {
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
56 int fd;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
57
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
58 GMarkupParseContext *context;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
59 xmlnode *current;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
60
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
61 enum {
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
62 JABBER_PROTO_0_9,
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
63 JABBER_PROTO_1_0
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
64 } protocol_version;
7291
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
65 enum {
8296
dd6fe7d965aa [gaim-migrate @ 9020]
Nathan Walp <nwalp@pidgin.im>
parents: 8113
diff changeset
66 JABBER_AUTH_UNKNOWN,
7291
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
67 JABBER_AUTH_DIGEST_MD5,
8296
dd6fe7d965aa [gaim-migrate @ 9020]
Nathan Walp <nwalp@pidgin.im>
parents: 8113
diff changeset
68 JABBER_AUTH_PLAIN,
dd6fe7d965aa [gaim-migrate @ 9020]
Nathan Walp <nwalp@pidgin.im>
parents: 8113
diff changeset
69 JABBER_AUTH_IQ_AUTH
7291
632cee95cc5c [gaim-migrate @ 7872]
Nathan Walp <nwalp@pidgin.im>
parents: 7170
diff changeset
70 } auth_type;
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
71 char *stream_id;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
72 JabberStreamState state;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
73
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
74 /* SASL authentication */
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
75 char *expected_rspauth;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
76
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
77 GHashTable *buddies;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
78 gboolean roster_parsed;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
79
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
80 GHashTable *chats;
8043
9a6df4d567e0 [gaim-migrate @ 8727]
Nathan Walp <nwalp@pidgin.im>
parents: 8016
diff changeset
81 GList *chat_servers;
8113
d60272410bd5 [gaim-migrate @ 8817]
Nathan Walp <nwalp@pidgin.im>
parents: 8043
diff changeset
82 GaimRoomlist *roomlist;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
83
8312
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
84 GHashTable *iq_callbacks;
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
85 GHashTable *disco_callbacks;
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
86 int next_id;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
87
8312
ba12d8b12ab0 [gaim-migrate @ 9036]
Nathan Walp <nwalp@pidgin.im>
parents: 8296
diff changeset
88
7395
b250288fa948 [gaim-migrate @ 7990]
Nathan Walp <nwalp@pidgin.im>
parents: 7291
diff changeset
89 GList *oob_file_transfers;
7170
1cf80749f2f0 [gaim-migrate @ 7737]
Nathan Walp <nwalp@pidgin.im>
parents: 7077
diff changeset
90 GList *file_transfers;
1cf80749f2f0 [gaim-migrate @ 7737]
Nathan Walp <nwalp@pidgin.im>
parents: 7077
diff changeset
91
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
92 time_t idle;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
93
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
94 JabberID *user;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
95 GaimConnection *gc;
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
96 GaimSslConnection *gsc;
7072
1350352f5818 [gaim-migrate @ 7637]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
97
1350352f5818 [gaim-migrate @ 7637]
Nathan Walp <nwalp@pidgin.im>
parents: 7014
diff changeset
98 gboolean registration;
10189
4e7249591251 [gaim-migrate @ 11304]
Nathan Walp <nwalp@pidgin.im>
parents: 8401
diff changeset
99
4e7249591251 [gaim-migrate @ 11304]
Nathan Walp <nwalp@pidgin.im>
parents: 8401
diff changeset
100 char *avatar_hash;
10941
cef48e318125 [gaim-migrate @ 12731]
Nathan Walp <nwalp@pidgin.im>
parents: 10189
diff changeset
101 GSList *pending_avatar_requests;
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
102 } JabberStream;
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
103
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
104 void jabber_process_packet(JabberStream *js, xmlnode *packet);
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
105 void jabber_send(JabberStream *js, xmlnode *data);
7642
9008b5be4275 [gaim-migrate @ 8285]
Nathan Walp <nwalp@pidgin.im>
parents: 7395
diff changeset
106 void jabber_send_raw(JabberStream *js, const char *data, int len);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
107
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
108 void jabber_stream_set_state(JabberStream *js, JabberStreamState state);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
109
7077
6d10bf28be0e [gaim-migrate @ 7642]
Nathan Walp <nwalp@pidgin.im>
parents: 7072
diff changeset
110 void jabber_register_parse(JabberStream *js, xmlnode *packet);
8016
7bae464195c4 [gaim-migrate @ 8696]
Nathan Walp <nwalp@pidgin.im>
parents: 7642
diff changeset
111 void jabber_register_start(JabberStream *js);
7077
6d10bf28be0e [gaim-migrate @ 7642]
Nathan Walp <nwalp@pidgin.im>
parents: 7072
diff changeset
112
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
113 char *jabber_get_next_id(JabberStream *js);
2086
424a40f12a6c [gaim-migrate @ 2096]
Eric Warmenhoven <eric@warmenhoven.org>
parents:
diff changeset
114
8401
c13a4913a071 [gaim-migrate @ 9130]
Nathan Walp <nwalp@pidgin.im>
parents: 8312
diff changeset
115 char *jabber_parse_error(JabberStream *js, xmlnode *packet);
c13a4913a071 [gaim-migrate @ 9130]
Nathan Walp <nwalp@pidgin.im>
parents: 8312
diff changeset
116
7014
67c4e9d39242 [gaim-migrate @ 7577]
Nathan Walp <nwalp@pidgin.im>
parents: 3717
diff changeset
117 #endif /* _GAIM_JABBER_H_ */