| |
1 /** |
| |
2 * @file jabber.h The Gaim interface to mDNS and peer to peer Jabber. |
| |
3 * |
| |
4 * gaim |
| |
5 * |
| |
6 * Gaim is the legal property of its developers, whose names are too numerous |
| |
7 * to list here. Please refer to the COPYRIGHT file distributed with this |
| |
8 * source distribution. |
| |
9 * |
| |
10 * This program is free software; you can redistribute it and/or modify |
| |
11 * it under the terms of the GNU General Public License as published by |
| |
12 * the Free Software Foundation; either version 2 of the License, or |
| |
13 * (at your option) any later version. |
| |
14 * |
| |
15 * This program is distributed in the hope that it will be useful, |
| |
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| |
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| |
18 * GNU General Public License for more details. |
| |
19 * |
| |
20 * You should have received a copy of the GNU General Public License |
| |
21 * along with this program; if not, write to the Free Software |
| |
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| |
23 * |
| |
24 */ |
| |
25 |
| |
26 #ifndef _BONJOUR_JABBER_H_ |
| |
27 #define _BONJOUR_JABBER_H_ |
| |
28 |
| |
29 #include "account.h" |
| |
30 |
| |
31 #define STREAM_END "</stream:stream>" |
| |
32 #define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" |
| |
33 |
| |
34 typedef struct _BonjourJabber |
| |
35 { |
| |
36 gint port; |
| |
37 gint socket; |
| |
38 gint watcher_id; |
| |
39 GaimAccount* account; |
| |
40 } BonjourJabber; |
| |
41 |
| |
42 typedef struct _BonjourJabberConversation |
| |
43 { |
| |
44 gint socket; |
| |
45 gint watcher_id; |
| |
46 gchar* buddy_name; |
| |
47 gboolean stream_started; |
| |
48 gint message_id; |
| |
49 } BonjourJabberConversation; |
| |
50 |
| |
51 /** |
| |
52 * Start listening for jabber connections. |
| |
53 * |
| |
54 * @return -1 if there was a problem, else returns the listening |
| |
55 * port number. |
| |
56 */ |
| |
57 gint bonjour_jabber_start(BonjourJabber *data); |
| |
58 |
| |
59 int bonjour_jabber_send_message(BonjourJabber *data, const gchar *to, const gchar *body); |
| |
60 |
| |
61 void bonjour_jabber_close_conversation(BonjourJabber *data, GaimBuddy *gb); |
| |
62 |
| |
63 void bonjour_jabber_stop(BonjourJabber *data); |
| |
64 |
| |
65 #endif /* _BONJOUR_JABBER_H_ */ |