Sun, 01 Sep 2013 01:40:21 +0530
Refactored the protocols to use the error argument of purple_protocols_{add/remove}
| 11477 | 1 | /** |
| 15884 | 2 | * @file bonjour.h The Purple interface to mDNS and peer to peer Jabber. |
| 11477 | 3 | * |
| 15884 | 4 | * purple |
| 11477 | 5 | * |
| 15884 | 6 | * Purple is the legal property of its developers, whose names are too numerous |
| 11477 | 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 | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
17596
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 11477 | 23 | * |
| 24 | */ | |
| 25 | ||
| 26 | #ifndef _BONJOUR_H_ | |
| 27 | #define _BONJOUR_H_ | |
| 28 | ||
|
36572
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
29 | #include "protocol.h" |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
30 | |
|
17596
45f6190fe54a
This is a patch from Chris Davies to make Bonjour work on Windows using the Apple Bonjour framework. It turns out that the actual DNS-SD library is (3 clause) BSD licensed, so we can use it.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
31 | #include "mdns_common.h" |
|
11823
22b98c118b71
[gaim-migrate @ 14114]
Mark Doliner <markdoliner@pidgin.im>
parents:
11539
diff
changeset
|
32 | #include "internal.h" |
| 11477 | 33 | #include "jabber.h" |
| 34 | ||
|
11823
22b98c118b71
[gaim-migrate @ 14114]
Mark Doliner <markdoliner@pidgin.im>
parents:
11539
diff
changeset
|
35 | #define BONJOUR_GROUP_NAME _("Bonjour") |
| 11477 | 36 | #define BONJOUR_PROTOCOL_NAME "bonjour" |
| 37 | #define BONJOUR_ICON_NAME "bonjour" | |
| 38 | ||
|
36572
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
39 | #define BONJOUR_ID "prpl-bonjour" |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
40 | #define BONJOUR_NAME "Bonjour" |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
41 | |
|
11496
0f61069a4a3f
[gaim-migrate @ 13740]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
42 | #define BONJOUR_STATUS_ID_OFFLINE "offline" |
|
0f61069a4a3f
[gaim-migrate @ 13740]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
43 | #define BONJOUR_STATUS_ID_AVAILABLE "available" |
|
0f61069a4a3f
[gaim-migrate @ 13740]
Mark Doliner <markdoliner@pidgin.im>
parents:
11477
diff
changeset
|
44 | #define BONJOUR_STATUS_ID_AWAY "away" |
| 11477 | 45 | |
|
25641
cf74c04c6f41
Better support running many Bonjour clients on the same machine by allowing a
Daniel Atallah <datallah@pidgin.im>
parents:
21944
diff
changeset
|
46 | #define BONJOUR_DEFAULT_PORT 5298 |
| 13971 | 47 | |
|
36572
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
48 | #define BONJOUR_TYPE_PROTOCOL (bonjour_protocol_get_type()) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
49 | #define BONJOUR_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), BONJOUR_TYPE_PROTOCOL, BonjourProtocol)) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
50 | #define BONJOUR_PROTOCOL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), BONJOUR_TYPE_PROTOCOL, BonjourProtocolClass)) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
51 | #define BONJOUR_IS_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), BONJOUR_TYPE_PROTOCOL)) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
52 | #define BONJOUR_IS_PROTOCOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), BONJOUR_TYPE_PROTOCOL)) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
53 | #define BONJOUR_PROTOCOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), BONJOUR_TYPE_PROTOCOL, BonjourProtocolClass)) |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
54 | |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
55 | typedef struct _BonjourProtocol |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
56 | { |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
57 | PurpleProtocol parent; |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
58 | } BonjourProtocol; |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
59 | |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
60 | typedef struct _BonjourProtocolClass |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
61 | { |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
62 | PurpleProtocolClass parent_class; |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
63 | } BonjourProtocolClass; |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
64 | |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11496
diff
changeset
|
65 | typedef struct _BonjourData |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11496
diff
changeset
|
66 | { |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11496
diff
changeset
|
67 | BonjourDnsSd *dns_sd_data; |
|
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11496
diff
changeset
|
68 | BonjourJabber *jabber_data; |
|
21944
c41d17a1b8d9
This is the second part of the fix to support having multiple presence records in Bonjour (and also supporting multiple presences using the same IP). Incoming conversations are no longer immediately attached to a buddy - we use an algorithm to match a conversation to a buddy based on the IP and, if possible the "from" attribute of the stream or the first tag in the stream. Thanks to Sjoerd Simons from Telepahy Salut for noticing and suggesting the algorithm. Fixes #4187. It'd be good if a few people test this.
Daniel Atallah <datallah@pidgin.im>
parents:
21524
diff
changeset
|
69 | GSList *xfer_lists; |
|
30825
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
70 | gchar *jid; |
|
11539
fbabe3f89777
[gaim-migrate @ 13794]
Mark Doliner <markdoliner@pidgin.im>
parents:
11496
diff
changeset
|
71 | } BonjourData; |
| 11477 | 72 | |
|
30825
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
73 | /** |
|
36572
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
74 | * Returns the GType for the BonjourProtocol object. |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
75 | */ |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
76 | GType bonjour_protocol_get_type(void); |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
77 | |
|
fdb3db620b38
Refactored bonjour to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
30825
diff
changeset
|
78 | /** |
|
30825
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
79 | * This will always be username@machinename |
|
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
80 | */ |
|
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
81 | const char *bonjour_get_jid(PurpleAccount *account); |
|
87a79bbdc985
The hostname used for a bonjour account should always be the current machine
Daniel Atallah <datallah@pidgin.im>
parents:
25641
diff
changeset
|
82 | |
| 11477 | 83 | #endif /* _BONJOUR_H_ */ |