Sat, 01 Jul 2006 22:32:20 +0000
[gaim-migrate @ 16390]
A small part of sf patch #1490646, from Jonty Wareing & Jono Cole
"Fix & Enhance the Bonjour prpl"
"Several instances of "magic strings" have been replaced
with proper XML parsing code in the Bonjour prpl,
allowing it to communicate with other Gaim clients (a
misplaced space in one of the strings prevented this),
and every other Bonjour chat client we can find.
A fair amount of completely redundant code was also
stripped, which in combination with the proper XML
parsing allows the client to be far more flexible about
Jabber errors in other clients."
committer: Mark Doliner <markdoliner@pidgin.im>
| 11477 | 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>" | |
| 13964 | 32 | #define DOCTYPE "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<stream:stream xmlns=\"jabber:client\" xmlns:stream=\"http://etherx.jabber.org/streams\">" |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
33 | |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
34 | typedef struct _BonjourJabber |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
35 | { |
| 11477 | 36 | gint port; |
| 37 | gint socket; | |
| 38 | gint watcher_id; | |
| 39 | GaimAccount* account; | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
40 | } BonjourJabber; |
| 11477 | 41 | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
42 | typedef struct _BonjourJabberConversation |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
43 | { |
| 11477 | 44 | gint socket; |
| 45 | gint watcher_id; | |
| 46 | gchar* buddy_name; | |
| 47 | gboolean stream_started; | |
| 48 | gint message_id; | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
49 | } BonjourJabberConversation; |
| 11477 | 50 | |
| 51 | /** | |
| 52 | * Start listening for jabber connections. Returns 0 if the connection could be | |
| 53 | * stablished, -1 if a problem appears. | |
| 54 | */ | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
55 | gint bonjour_jabber_start(BonjourJabber *data); |
| 11477 | 56 | |
|
11693
1a42a66ca0f8
[gaim-migrate @ 13979]
Mark Doliner <markdoliner@pidgin.im>
parents:
11539
diff
changeset
|
57 | int bonjour_jabber_send_message(BonjourJabber *data, const gchar *to, const gchar *body); |
| 11477 | 58 | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
59 | void bonjour_jabber_close_conversation(BonjourJabber *data, GaimBuddy *gb); |
| 11477 | 60 | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
61 | void bonjour_jabber_stop(BonjourJabber *data); |
| 11477 | 62 | |
| 63 | #endif /* _BONJOUR_JABBER_H_ */ |