Mercurial > pidgin.yaz
annotate src/protocols/jabber/jabber.h @ 13384:a580ffe73314
[gaim-migrate @ 15757]
jabber updates, including the first half of JEP-0115 support, and maybe the
fix for jabber plaintext messages not having their line-endings preserved
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 03 Mar 2006 03:38:36 +0000 |
parents | 33bef17125c2 |
children | 25e63008d3bb |
rev | line source |
---|---|
7014 | 1 /** |
2 * @file jabber.h | |
3 * | |
4 * gaim | |
5 * | |
6 * Copyright (C) 2003 Nathan Walp <faceprint@faceprint.com> | |
2086 | 7 * |
7014 | 8 * This program is free software; you can redistribute it and/or modify |
9 * it under the terms of the GNU General Public License as published by | |
10 * the Free Software Foundation; either version 2 of the License, or | |
11 * (at your option) any later version. | |
2086 | 12 * |
7014 | 13 * This program is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 * GNU General Public License for more details. | |
2086 | 17 * |
7014 | 18 * You should have received a copy of the GNU General Public License |
19 * along with this program; if not, write to the Free Software | |
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
2086 | 21 */ |
7014 | 22 #ifndef _GAIM_JABBER_H_ |
23 #define _GAIM_JABBER_H_ | |
2086 | 24 |
7014 | 25 #include <glib.h> |
26 #include "connection.h" | |
8113 | 27 #include "roomlist.h" |
7014 | 28 #include "sslconn.h" |
13200
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
12508
diff
changeset
|
29 #include "gaim_buffer.h" |
2086 | 30 |
7014 | 31 #include "jutil.h" |
32 #include "xmlnode.h" | |
2086 | 33 |
12508 | 34 #ifdef HAVE_CYRUS_SASL |
35 #include <sasl/sasl.h> | |
36 #endif | |
37 | |
13384 | 38 #define CAPS0115_NODE "http://gaim.sf.net/caps" |
39 | |
7014 | 40 typedef enum { |
8312 | 41 JABBER_CAP_NONE = 0, |
42 JABBER_CAP_XHTML = 1 << 0, | |
43 JABBER_CAP_COMPOSING = 1 << 1, | |
44 JABBER_CAP_SI = 1 << 2, | |
45 JABBER_CAP_SI_FILE_XFER = 1 << 3, | |
46 JABBER_CAP_BYTESTREAMS = 1 << 4, | |
47 JABBER_CAP_IBB = 1 << 5, | |
11393 | 48 JABBER_CAP_CHAT_STATES = 1 << 6, |
11675 | 49 JABBER_CAP_IQ_SEARCH = 1 << 7, |
50 JABBER_CAP_IQ_REGISTER = 1 << 8, | |
8312 | 51 JABBER_CAP_RETRIEVED = 1 << 31 |
52 } JabberCapabilities; | |
53 | |
54 typedef enum { | |
7014 | 55 JABBER_STREAM_OFFLINE, |
56 JABBER_STREAM_CONNECTING, | |
57 JABBER_STREAM_INITIALIZING, | |
58 JABBER_STREAM_AUTHENTICATING, | |
59 JABBER_STREAM_REINITIALIZING, | |
60 JABBER_STREAM_CONNECTED | |
61 } JabberStreamState; | |
2086 | 62 |
7014 | 63 typedef struct _JabberStream |
2086 | 64 { |
7014 | 65 int fd; |
2086 | 66 |
7014 | 67 GMarkupParseContext *context; |
68 xmlnode *current; | |
2086 | 69 |
7014 | 70 enum { |
71 JABBER_PROTO_0_9, | |
72 JABBER_PROTO_1_0 | |
73 } protocol_version; | |
7291 | 74 enum { |
8296 | 75 JABBER_AUTH_UNKNOWN, |
7291 | 76 JABBER_AUTH_DIGEST_MD5, |
8296 | 77 JABBER_AUTH_PLAIN, |
12508 | 78 JABBER_AUTH_IQ_AUTH, |
79 JABBER_AUTH_CYRUS | |
7291 | 80 } auth_type; |
7014 | 81 char *stream_id; |
82 JabberStreamState state; | |
2086 | 83 |
7014 | 84 /* SASL authentication */ |
85 char *expected_rspauth; | |
2086 | 86 |
7014 | 87 GHashTable *buddies; |
88 gboolean roster_parsed; | |
2086 | 89 |
7014 | 90 GHashTable *chats; |
8043 | 91 GList *chat_servers; |
8113 | 92 GaimRoomlist *roomlist; |
11675 | 93 GList *user_directories; |
2086 | 94 |
8312 | 95 GHashTable *iq_callbacks; |
96 GHashTable *disco_callbacks; | |
7014 | 97 int next_id; |
2086 | 98 |
8312 | 99 |
7395 | 100 GList *oob_file_transfers; |
7170 | 101 GList *file_transfers; |
102 | |
7014 | 103 time_t idle; |
2086 | 104 |
7014 | 105 JabberID *user; |
106 GaimConnection *gc; | |
107 GaimSslConnection *gsc; | |
7072 | 108 |
109 gboolean registration; | |
10189 | 110 |
111 char *avatar_hash; | |
10941 | 112 GSList *pending_avatar_requests; |
12508 | 113 |
13200
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
12508
diff
changeset
|
114 GaimCircBuffer *write_buffer; |
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
12508
diff
changeset
|
115 guint writeh; |
33bef17125c2
[gaim-migrate @ 15563]
Daniel Atallah <daniel.atallah@gmail.com>
parents:
12508
diff
changeset
|
116 |
12508 | 117 /* OK, this stays at the end of the struct, so plugins can depend |
118 * on the rest of the stuff being in the right place | |
119 */ | |
120 #ifdef HAVE_CYRUS_SASL | |
121 sasl_conn_t *sasl; | |
122 sasl_callback_t *sasl_cb; | |
123 int sasl_state; | |
124 int sasl_maxbuf; | |
125 GString *sasl_mechs; | |
126 #endif | |
127 | |
7014 | 128 } JabberStream; |
2086 | 129 |
7014 | 130 void jabber_process_packet(JabberStream *js, xmlnode *packet); |
131 void jabber_send(JabberStream *js, xmlnode *data); | |
7642 | 132 void jabber_send_raw(JabberStream *js, const char *data, int len); |
2086 | 133 |
7014 | 134 void jabber_stream_set_state(JabberStream *js, JabberStreamState state); |
2086 | 135 |
7077 | 136 void jabber_register_parse(JabberStream *js, xmlnode *packet); |
8016 | 137 void jabber_register_start(JabberStream *js); |
7077 | 138 |
7014 | 139 char *jabber_get_next_id(JabberStream *js); |
2086 | 140 |
8401 | 141 char *jabber_parse_error(JabberStream *js, xmlnode *packet); |
142 | |
7014 | 143 #endif /* _GAIM_JABBER_H_ */ |