Mercurial > pidgin.yaz
comparison libpurple/protocols/bonjour/buddy.h @ 17733:d7b50cac1c7a
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.
There are a few changes by me, mainly to fix the howl implementation.
Fixes #1117 .
There appear to be a few bugs, but I believe that they were also present previously. I'm hoping to do some more tweaking before the next release.
The howl implementation will eventually be supersceded by a native avahi implementation, so I opted for a somewhat dirty hack to enable it instead of doing something with config.h.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Tue, 05 Jun 2007 03:38:22 +0000 |
parents | 32c366eeeb99 |
children | c921f901c7ea |
comparison
equal
deleted
inserted
replaced
17726:7e856734b712 | 17733:d7b50cac1c7a |
---|---|
15 */ | 15 */ |
16 | 16 |
17 #ifndef _BONJOUR_BUDDY | 17 #ifndef _BONJOUR_BUDDY |
18 #define _BONJOUR_BUDDY | 18 #define _BONJOUR_BUDDY |
19 | 19 |
20 #include <howl.h> | |
21 #include <glib.h> | 20 #include <glib.h> |
22 | 21 |
22 #include "config.h" | |
23 #include "account.h" | 23 #include "account.h" |
24 #include "jabber.h" | 24 #include "jabber.h" |
25 | 25 |
26 #ifdef USE_BONJOUR_APPLE | |
27 #include "dns_sd_proxy.h" | |
28 #else /* USE_BONJOUR_HOWL */ | |
29 #include <howl.h> | |
30 #endif | |
31 | |
26 typedef struct _BonjourBuddy | 32 typedef struct _BonjourBuddy |
27 { | 33 { |
34 PurpleAccount *account; | |
35 | |
28 gchar *name; | 36 gchar *name; |
29 gchar *first; | 37 gchar *first; |
30 gint port_p2pj; | 38 gint port_p2pj; |
31 gchar *phsh; | 39 gchar *phsh; |
32 gchar *status; | 40 gchar *status; |
35 gchar *jid; | 43 gchar *jid; |
36 gchar *AIM; | 44 gchar *AIM; |
37 gchar *vc; | 45 gchar *vc; |
38 gchar *ip; | 46 gchar *ip; |
39 gchar *msg; | 47 gchar *msg; |
48 | |
40 BonjourJabberConversation *conversation; | 49 BonjourJabberConversation *conversation; |
50 | |
51 #ifdef USE_BONJOUR_APPLE | |
52 DNSServiceRef txt_query; | |
53 int txt_query_fd; | |
54 #endif | |
55 | |
41 } BonjourBuddy; | 56 } BonjourBuddy; |
57 | |
58 typedef enum _bonjour_buddy_member | |
59 { | |
60 E_BUDDY_FIRST, | |
61 E_BUDDY_LAST, | |
62 E_BUDDY_STATUS, | |
63 E_BUDDY_EMAIL, | |
64 E_BUDDY_PHSH, | |
65 E_BUDDY_JID, | |
66 E_BUDDY_AIM, | |
67 E_BUDDY_VC, | |
68 E_BUDDY_MSG | |
69 } bonjour_buddy_member; | |
42 | 70 |
43 /** | 71 /** |
44 * Creates a new buddy. | 72 * Creates a new buddy. |
45 */ | 73 */ |
46 BonjourBuddy *bonjour_buddy_new(const gchar *name, const gchar *first, | 74 BonjourBuddy *bonjour_buddy_new(const gchar *name, PurpleAccount* account); |
47 gint port_p2pj, const gchar *phsh, const gchar *status, | 75 |
48 const gchar *email, const gchar *last, const gchar *jid, | 76 /** |
49 const gchar *AIM, const gchar *vc, const gchar *ip, const gchar *msg); | 77 * Sets a value in the BonjourBuddy struct, destroying the old value |
78 */ | |
79 void set_bonjour_buddy_value(BonjourBuddy* buddy, bonjour_buddy_member member, const char* value, uint32_t len); | |
50 | 80 |
51 /** | 81 /** |
52 * Check if all the compulsory buddy data is present. | 82 * Check if all the compulsory buddy data is present. |
53 */ | 83 */ |
54 gboolean bonjour_buddy_check(BonjourBuddy *buddy); | 84 gboolean bonjour_buddy_check(BonjourBuddy *buddy); |
55 | 85 |
56 /** | 86 /** |
57 * If the buddy doesn't previoulsy exists, it is created. Else, its data is changed (???) | 87 * If the buddy doesn't previoulsy exists, it is created. Else, its data is changed (???) |
58 */ | 88 */ |
59 void bonjour_buddy_add_to_purple(PurpleAccount *account, BonjourBuddy *buddy); | 89 void bonjour_buddy_add_to_purple(BonjourBuddy *buddy); |
60 | 90 |
61 /** | 91 /** |
62 * Deletes a buddy from memory. | 92 * Deletes a buddy from memory. |
63 */ | 93 */ |
64 void bonjour_buddy_delete(BonjourBuddy *buddy); | 94 void bonjour_buddy_delete(BonjourBuddy *buddy); |