Mercurial > pidgin
annotate libpurple/protocols/bonjour/mdns_avahi.c @ 28429:1c542f86dbcf
Removed XEPs we already support and those that have become obsoleted.
Maybe we should drop this file, since we a have a list on the wiki?
author | Marcus Lundblad <ml@update.uu.se> |
---|---|
date | Sun, 25 Oct 2009 15:17:17 +0000 |
parents | deecc1d663c4 |
children | 9d6e1327f614 |
rev | line source |
---|---|
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
1 /* |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
2 * This program is free software; you can redistribute it and/or modify |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
3 * it under the terms of the GNU General Public License as published by |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
4 * the Free Software Foundation; either version 2 of the License, or |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
5 * (at your option) any later version. |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
6 * |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
7 * This program is distributed in the hope that it will be useful, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
10 * GNU Library General Public License for more details. |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
11 * |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
12 * You should have received a copy of the GNU General Public License |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
13 * along with this program; if not, write to the Free Software |
19681
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19654
diff
changeset
|
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, USA. |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
15 */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
16 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
17 #include "internal.h" |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
18 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
19 #include "mdns_interface.h" |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
20 #include "debug.h" |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
21 #include "buddy.h" |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
22 #include "bonjour.h" |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
23 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
24 #include <avahi-client/client.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
25 #include <avahi-client/lookup.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
26 #include <avahi-client/publish.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
27 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
28 #include <avahi-common/address.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
29 #include <avahi-common/malloc.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
30 #include <avahi-common/error.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
31 #include <avahi-common/strlst.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
32 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
33 #include <avahi-glib/glib-malloc.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
34 #include <avahi-glib/glib-watch.h> |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
35 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
36 /* Avahi only defines the types that it actually uses (which at this time doesn't include NULL) */ |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
37 #ifndef AVAHI_DNS_TYPE_NULL |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
38 #define AVAHI_DNS_TYPE_NULL 0x0A |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
39 #endif |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
40 |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
41 /* data used by avahi bonjour implementation */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
42 typedef struct _avahi_session_impl_data { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
43 AvahiClient *client; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
44 AvahiGLibPoll *glib_poll; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
45 AvahiServiceBrowser *sb; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
46 AvahiEntryGroup *group; |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
47 AvahiEntryGroup *buddy_icon_group; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
48 } AvahiSessionImplData; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
49 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
50 typedef struct _avahi_buddy_service_resolver_data { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
51 AvahiServiceResolver *resolver; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
52 AvahiIfIndex interface; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
53 AvahiProtocol protocol; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
54 gchar *name; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
55 gchar *type; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
56 gchar *domain; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
57 /* This is a reference to the entry in BonjourBuddy->ips */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
58 const char *ip; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
59 } AvahiSvcResolverData; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
60 |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
61 typedef struct _avahi_buddy_impl_data { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
62 GSList *resolvers; |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
63 AvahiRecordBrowser *buddy_icon_rec_browser; |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
64 } AvahiBuddyImplData; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
65 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
66 static gint |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
67 _find_resolver_data(gconstpointer a, gconstpointer b) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
68 const AvahiSvcResolverData *rd_a = a; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
69 const AvahiSvcResolverData *rd_b = b; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
70 gint ret = 1; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
71 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
72 if(rd_a->interface == rd_b->interface |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
73 && rd_a->protocol == rd_b->protocol |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
74 && !strcmp(rd_a->name, rd_b->name) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
75 && !strcmp(rd_a->type, rd_b->type) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
76 && !strcmp(rd_a->domain, rd_b->domain)) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
77 ret = 0; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
78 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
79 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
80 return ret; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
81 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
82 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
83 static gint |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
84 _find_resolver_data_by_resolver(gconstpointer a, gconstpointer b) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
85 const AvahiSvcResolverData *rd_a = a; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
86 const AvahiServiceResolver *resolver = b; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
87 gint ret = 1; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
88 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
89 if(rd_a->resolver == resolver) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
90 ret = 0; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
91 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
92 return ret; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
93 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
94 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
95 static void |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
96 _cleanup_resolver_data(AvahiSvcResolverData *rd) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
97 if (rd->resolver) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
98 avahi_service_resolver_free(rd->resolver); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
99 g_free(rd->name); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
100 g_free(rd->type); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
101 g_free(rd->domain); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
102 g_free(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
103 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
104 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
105 |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
106 static void |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
107 _resolver_callback(AvahiServiceResolver *r, AvahiIfIndex interface, AvahiProtocol protocol, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
108 AvahiResolverEvent event, const char *name, const char *type, const char *domain, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
109 const char *host_name, const AvahiAddress *a, uint16_t port, AvahiStringList *txt, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
110 AvahiLookupResultFlags flags, void *userdata) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
111 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
112 PurpleBuddy *pb; |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
113 BonjourBuddy *bb; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
114 PurpleAccount *account = userdata; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
115 AvahiStringList *l; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
116 size_t size; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
117 char *key, *value; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
118 int ret; |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
119 char ip[AVAHI_ADDRESS_STR_MAX]; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
120 AvahiBuddyImplData *b_impl; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
121 AvahiSvcResolverData *rd; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
122 GSList *res; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
123 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
124 g_return_if_fail(r != NULL); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
125 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
126 pb = purple_find_buddy(account, name); |
25791
252e26edb7a9
Finished moving to api for bonjour
Gary Kramlich <grim@reaperworld.com>
parents:
22975
diff
changeset
|
127 bb = (pb != NULL) ? purple_buddy_get_protocol_data(pb) : NULL; |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
128 |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
129 switch (event) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
130 case AVAHI_RESOLVER_FAILURE: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
131 purple_debug_error("bonjour", "_resolve_callback - Failure: %s\n", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
132 avahi_strerror(avahi_client_errno(avahi_service_resolver_get_client(r)))); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
133 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
134 avahi_service_resolver_free(r); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
135 if (bb != NULL) { |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
136 b_impl = bb->mdns_impl_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
137 res = g_slist_find_custom(b_impl->resolvers, r, _find_resolver_data_by_resolver); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
138 if (res != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
139 rd = res->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
140 b_impl->resolvers = g_slist_remove_link(b_impl->resolvers, res); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
141 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
142 /* We've already freed the resolver */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
143 rd->resolver = NULL; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
144 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
145 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
146 /* If this was the last resolver, remove the buddy */ |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
147 if (b_impl->resolvers == NULL) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
148 bonjour_buddy_signed_off(pb); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
149 } |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
150 } |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
151 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
152 case AVAHI_RESOLVER_FOUND: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
153 /* create a buddy record */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
154 if (bb == NULL) |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
155 bb = bonjour_buddy_new(name, account); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
156 b_impl = bb->mdns_impl_data; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
157 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
158 /* If we're reusing an existing buddy, it may be a new resolver or an existing one. */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
159 res = g_slist_find_custom(b_impl->resolvers, r, _find_resolver_data_by_resolver); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
160 if (res != NULL) |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
161 rd = res->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
162 else { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
163 rd = g_new0(AvahiSvcResolverData, 1); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
164 rd->resolver = r; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
165 rd->interface = interface; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
166 rd->protocol = protocol; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
167 rd->name = g_strdup(name); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
168 rd->type = g_strdup(type); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
169 rd->domain = g_strdup(domain); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
170 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
171 b_impl->resolvers = g_slist_prepend(b_impl->resolvers, rd); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
172 } |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
173 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
174 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
175 /* Get the ip as a string */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
176 avahi_address_snprint(ip, AVAHI_ADDRESS_STR_MAX, a); |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
177 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
178 if (rd->ip == NULL || strcmp(rd->ip, ip) != 0) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
179 /* We store duplicates in bb->ips, so we always remove the one */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
180 if (rd->ip != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
181 bb->ips = g_slist_remove(bb->ips, rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
182 g_free((gchar *) rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
183 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
184 bb->ips = g_slist_prepend(bb->ips, g_strdup(ip)); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
185 rd->ip = bb->ips->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
186 } |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
187 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
188 bb->port_p2pj = port; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
189 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
190 /* Obtain the parameters from the text_record */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
191 clear_bonjour_buddy_values(bb); |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
192 for(l = txt; l != NULL; l = l->next) { |
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
193 if ((ret = avahi_string_list_get_pair(l, &key, &value, &size)) < 0) |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
194 continue; |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
195 set_bonjour_buddy_value(bb, key, value, size); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
196 /* TODO: Since we're using the glib allocator, I think we |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
197 * can use the values instead of re-copying them */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
198 avahi_free(key); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
199 avahi_free(value); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
200 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
201 |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
202 if (!bonjour_buddy_check(bb)) { |
27800
deecc1d663c4
Don't use pointers (even opaquely) once they're freed. Closes #9822.
Paul Aurich <paul@darkrain42.org>
parents:
26939
diff
changeset
|
203 b_impl->resolvers = g_slist_remove(b_impl->resolvers, rd); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
204 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
205 /* If this was the last resolver, remove the buddy */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
206 if (b_impl->resolvers == NULL) { |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
207 if (pb != NULL) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
208 bonjour_buddy_signed_off(pb); |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
209 else |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
210 bonjour_buddy_delete(bb); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
211 } |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
212 } else |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
213 /* Add or update the buddy in our buddy list */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
214 bonjour_buddy_add_to_purple(bb, pb); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
215 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
216 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
217 default: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
218 purple_debug_info("bonjour", "Unrecognized Service Resolver event: %d.\n", event); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
219 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
220 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
221 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
222 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
223 static void |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
224 _browser_callback(AvahiServiceBrowser *b, AvahiIfIndex interface, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
225 AvahiProtocol protocol, AvahiBrowserEvent event, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
226 const char *name, const char *type, const char *domain, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
227 AvahiLookupResultFlags flags, void *userdata) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
228 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
229 PurpleAccount *account = userdata; |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
230 PurpleBuddy *pb = NULL; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
231 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
232 switch (event) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
233 case AVAHI_BROWSER_FAILURE: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
234 purple_debug_error("bonjour", "_browser_callback - Failure: %s\n", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
235 avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b)))); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
236 /* TODO: This is an error that should be handled. */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
237 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
238 case AVAHI_BROWSER_NEW: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
239 /* A new peer has joined the network and uses iChat bonjour */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
240 purple_debug_info("bonjour", "_browser_callback - new service\n"); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
241 /* Make sure it isn't us */ |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
242 if (purple_utf8_strcasecmp(name, account->username) != 0) { |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
243 if (!avahi_service_resolver_new(avahi_service_browser_get_client(b), |
21696
fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
244 interface, protocol, name, type, domain, AVAHI_PROTO_INET, |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
245 0, _resolver_callback, account)) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
246 purple_debug_warning("bonjour", "_browser_callback -- Error initiating resolver: %s\n", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
247 avahi_strerror(avahi_client_errno(avahi_service_browser_get_client(b)))); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
248 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
249 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
250 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
251 case AVAHI_BROWSER_REMOVE: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
252 purple_debug_info("bonjour", "_browser_callback - Remove service\n"); |
19573
affacee881e8
Fix a couple potential leaks and prevent the avahi record resolver from being freed multiple times.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18859
diff
changeset
|
253 pb = purple_find_buddy(account, name); |
21527
5b9da9db7e81
Various bugfixes including using purple_account_remove_buddy() in addition to purple_blist_remove_buddy() to make sure that the buddy gets cleaned up fully when logging out or we go offline.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19681
diff
changeset
|
254 if (pb != NULL) { |
25791
252e26edb7a9
Finished moving to api for bonjour
Gary Kramlich <grim@reaperworld.com>
parents:
22975
diff
changeset
|
255 BonjourBuddy *bb = purple_buddy_get_protocol_data(pb); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
256 AvahiBuddyImplData *b_impl; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
257 GSList *l; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
258 AvahiSvcResolverData *rd_search; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
259 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
260 g_return_if_fail(bb != NULL); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
261 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
262 b_impl = bb->mdns_impl_data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
263 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
264 /* There may be multiple presences, we should only get rid of this one */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
265 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
266 rd_search = g_new0(AvahiSvcResolverData, 1); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
267 rd_search->interface = interface; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
268 rd_search->protocol = protocol; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
269 rd_search->name = (gchar *) name; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
270 rd_search->type = (gchar *) type; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
271 rd_search->domain = (gchar *) domain; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
272 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
273 l = g_slist_find_custom(b_impl->resolvers, rd_search, _find_resolver_data); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
274 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
275 g_free(rd_search); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
276 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
277 if (l != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
278 AvahiSvcResolverData *rd = l->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
279 b_impl->resolvers = g_slist_remove(b_impl->resolvers, rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
280 /* This IP is no longer available */ |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
281 if (rd->ip != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
282 bb->ips = g_slist_remove(bb->ips, rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
283 g_free((gchar *) rd->ip); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
284 } |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
285 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
286 |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
287 /* If this was the last resolver, remove the buddy */ |
22975
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
288 if (b_impl->resolvers == NULL) |
d50194ab3016
Bonjour buddies will be saved persistently if they're moved out of the
Daniel Atallah <daniel.atallah@gmail.com>
parents:
22052
diff
changeset
|
289 bonjour_buddy_signed_off(pb); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
290 } |
21527
5b9da9db7e81
Various bugfixes including using purple_account_remove_buddy() in addition to purple_blist_remove_buddy() to make sure that the buddy gets cleaned up fully when logging out or we go offline.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
19681
diff
changeset
|
291 } |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
292 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
293 case AVAHI_BROWSER_ALL_FOR_NOW: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
294 case AVAHI_BROWSER_CACHE_EXHAUSTED: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
295 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
296 default: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
297 purple_debug_info("bonjour", "Unrecognized Service browser event: %d.\n", event); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
298 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
299 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
300 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
301 static void |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
302 _buddy_icon_group_cb(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
303 BonjourDnsSd *data = userdata; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
304 AvahiSessionImplData *idata = data->mdns_impl_data; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
305 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
306 g_return_if_fail(g == idata->buddy_icon_group || idata->buddy_icon_group == NULL); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
307 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
308 switch(state) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
309 case AVAHI_ENTRY_GROUP_ESTABLISHED: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
310 purple_debug_info("bonjour", "Successfully registered buddy icon data.\n"); |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
311 break; |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
312 case AVAHI_ENTRY_GROUP_COLLISION: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
313 purple_debug_error("bonjour", "Collision registering buddy icon data.\n"); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
314 break; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
315 case AVAHI_ENTRY_GROUP_FAILURE: |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19573
diff
changeset
|
316 purple_debug_error("bonjour", "Error registering buddy icon data: %s.\n", |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
317 avahi_strerror(avahi_client_errno(avahi_entry_group_get_client(g)))); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
318 break; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
319 case AVAHI_ENTRY_GROUP_UNCOMMITED: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
320 case AVAHI_ENTRY_GROUP_REGISTERING: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
321 break; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
322 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
323 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
324 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
325 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
326 static void |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
327 _entry_group_cb(AvahiEntryGroup *g, AvahiEntryGroupState state, void *userdata) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
328 AvahiSessionImplData *idata = userdata; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
329 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
330 g_return_if_fail(g == idata->group || idata->group == NULL); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
331 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
332 switch(state) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
333 case AVAHI_ENTRY_GROUP_ESTABLISHED: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
334 purple_debug_info("bonjour", "Successfully registered service.\n"); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
335 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
336 case AVAHI_ENTRY_GROUP_COLLISION: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
337 purple_debug_error("bonjour", "Collision registering entry group.\n"); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
338 /* TODO: Handle error - this should log out the account. (Possibly with "wants to die")*/ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
339 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
340 case AVAHI_ENTRY_GROUP_FAILURE: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
341 purple_debug_error("bonjour", "Error registering entry group: %s\n.", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
342 avahi_strerror(avahi_client_errno(avahi_entry_group_get_client(g)))); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
343 /* TODO: Handle error - this should log out the account.*/ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
344 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
345 case AVAHI_ENTRY_GROUP_UNCOMMITED: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
346 case AVAHI_ENTRY_GROUP_REGISTERING: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
347 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
348 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
349 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
350 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
351 |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
352 static void |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
353 _buddy_icon_record_cb(AvahiRecordBrowser *b, AvahiIfIndex interface, AvahiProtocol protocol, |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
354 AvahiBrowserEvent event, const char *name, uint16_t clazz, uint16_t type, |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
355 const void *rdata, size_t size, AvahiLookupResultFlags flags, void *userdata) { |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
356 BonjourBuddy *buddy = userdata; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
357 AvahiBuddyImplData *idata = buddy->mdns_impl_data; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
358 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
359 switch (event) { |
26939
e40a30c883cc
Correctly ignore Avahi's informational events when querying records for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25791
diff
changeset
|
360 case AVAHI_BROWSER_CACHE_EXHAUSTED: |
e40a30c883cc
Correctly ignore Avahi's informational events when querying records for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25791
diff
changeset
|
361 case AVAHI_BROWSER_ALL_FOR_NOW: |
e40a30c883cc
Correctly ignore Avahi's informational events when querying records for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25791
diff
changeset
|
362 /* Ignore these "meta" informational events */ |
e40a30c883cc
Correctly ignore Avahi's informational events when querying records for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25791
diff
changeset
|
363 return; |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
364 case AVAHI_BROWSER_NEW: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
365 bonjour_buddy_got_buddy_icon(buddy, rdata, size); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
366 break; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
367 case AVAHI_BROWSER_REMOVE: |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
368 case AVAHI_BROWSER_FAILURE: |
26939
e40a30c883cc
Correctly ignore Avahi's informational events when querying records for the
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
25791
diff
changeset
|
369 purple_debug_error("bonjour", "Error retrieving buddy icon record: %s\n", |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
370 avahi_strerror(avahi_client_errno(avahi_record_browser_get_client(b)))); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
371 break; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
372 } |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
373 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
374 /* Stop listening */ |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
375 avahi_record_browser_free(b); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
376 if (idata->buddy_icon_rec_browser == b) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
377 idata->buddy_icon_rec_browser = NULL; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
378 } |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
379 } |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
380 |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
381 /**************************** |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
382 * mdns_interface functions * |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
383 ****************************/ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
384 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
385 gboolean _mdns_init_session(BonjourDnsSd *data) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
386 AvahiSessionImplData *idata = g_new0(AvahiSessionImplData, 1); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
387 const AvahiPoll *poll_api; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
388 int error; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
389 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
390 /* Tell avahi to use g_malloc and g_free */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
391 avahi_set_allocator (avahi_glib_allocator ()); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
392 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
393 /* This currently depends on the glib mainloop, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
394 * we should make it use the libpurple abstraction */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
395 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
396 idata->glib_poll = avahi_glib_poll_new(NULL, G_PRIORITY_DEFAULT); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
397 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
398 poll_api = avahi_glib_poll_get(idata->glib_poll); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
399 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
400 idata->client = avahi_client_new(poll_api, 0, NULL, data, &error); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
401 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
402 if (idata->client == NULL) { |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19573
diff
changeset
|
403 purple_debug_error("bonjour", "Error initializing Avahi: %s\n", avahi_strerror(error)); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
404 avahi_glib_poll_free(idata->glib_poll); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
405 g_free(idata); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
406 return FALSE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
407 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
408 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
409 data->mdns_impl_data = idata; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
410 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
411 return TRUE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
412 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
413 |
18859
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
414 gboolean _mdns_publish(BonjourDnsSd *data, PublishType type, GSList *records) { |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
415 int publish_result = 0; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
416 AvahiSessionImplData *idata = data->mdns_impl_data; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
417 AvahiStringList *lst = NULL; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
418 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
419 g_return_val_if_fail(idata != NULL, FALSE); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
420 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
421 if (!idata->group) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
422 idata->group = avahi_entry_group_new(idata->client, |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
423 _entry_group_cb, idata); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
424 if (!idata->group) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
425 purple_debug_error("bonjour", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
426 "Unable to initialize the data for the mDNS (%s).\n", |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
427 avahi_strerror(avahi_client_errno(idata->client))); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
428 return FALSE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
429 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
430 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
431 |
18859
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
432 while (records) { |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
433 PurpleKeyValuePair *kvp = records->data; |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
434 lst = avahi_string_list_add_pair(lst, kvp->key, kvp->value); |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
435 records = records->next; |
c1546f6c0432
Yay for code reuse.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18858
diff
changeset
|
436 } |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
437 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
438 /* Publish the service */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
439 switch (type) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
440 case PUBLISH_START: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
441 publish_result = avahi_entry_group_add_service_strlst( |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
442 idata->group, AVAHI_IF_UNSPEC, |
21696
fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
443 AVAHI_PROTO_INET, 0, |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
444 purple_account_get_username(data->account), |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
445 LINK_LOCAL_RECORD_NAME, NULL, NULL, data->port_p2pj, lst); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
446 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
447 case PUBLISH_UPDATE: |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
448 publish_result = avahi_entry_group_update_service_txt_strlst( |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
449 idata->group, AVAHI_IF_UNSPEC, |
21696
fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
450 AVAHI_PROTO_INET, 0, |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
451 purple_account_get_username(data->account), |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
452 LINK_LOCAL_RECORD_NAME, NULL, lst); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
453 break; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
454 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
455 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
456 /* Free the memory used by temp data */ |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
457 avahi_string_list_free(lst); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
458 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
459 if (publish_result < 0) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
460 purple_debug_error("bonjour", |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
461 "Failed to add the " LINK_LOCAL_RECORD_NAME " service. Error: %s\n", |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
462 avahi_strerror(publish_result)); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
463 return FALSE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
464 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
465 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
466 if (type == PUBLISH_START |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
467 && (publish_result = avahi_entry_group_commit(idata->group)) < 0) { |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
468 purple_debug_error("bonjour", |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
469 "Failed to commit " LINK_LOCAL_RECORD_NAME " service. Error: %s\n", |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
470 avahi_strerror(publish_result)); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
471 return FALSE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
472 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
473 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
474 return TRUE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
475 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
476 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
477 gboolean _mdns_browse(BonjourDnsSd *data) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
478 AvahiSessionImplData *idata = data->mdns_impl_data; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
479 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
480 g_return_val_if_fail(idata != NULL, FALSE); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
481 |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
482 idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, LINK_LOCAL_RECORD_NAME, NULL, 0, _browser_callback, data->account); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
483 if (!idata->sb) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
484 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
485 purple_debug_error("bonjour", |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19573
diff
changeset
|
486 "Unable to initialize service browser. Error: %s.\n", |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
487 avahi_strerror(avahi_client_errno(idata->client))); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
488 return FALSE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
489 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
490 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
491 return TRUE; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
492 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
493 |
18845
09f52521ff5b
Fix bonjour buddy icons to work with iChat.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18843
diff
changeset
|
494 gboolean _mdns_set_buddy_icon_data(BonjourDnsSd *data, gconstpointer avatar_data, gsize avatar_len) { |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
495 AvahiSessionImplData *idata = data->mdns_impl_data; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
496 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
497 if (idata == NULL || idata->client == NULL) |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
498 return FALSE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
499 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
500 if (avatar_data != NULL) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
501 gboolean new_group = FALSE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
502 gchar *svc_name; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
503 int ret; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
504 AvahiPublishFlags flags = 0; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
505 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
506 if (idata->buddy_icon_group == NULL) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
507 purple_debug_info("bonjour", "Setting new buddy icon.\n"); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
508 new_group = TRUE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
509 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
510 idata->buddy_icon_group = avahi_entry_group_new(idata->client, |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
511 _buddy_icon_group_cb, data); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
512 } else { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
513 purple_debug_info("bonjour", "Updating existing buddy icon.\n"); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
514 flags |= AVAHI_PUBLISH_UPDATE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
515 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
516 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
517 if (idata->buddy_icon_group == NULL) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
518 purple_debug_error("bonjour", |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
519 "Unable to initialize the buddy icon group (%s).\n", |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
520 avahi_strerror(avahi_client_errno(idata->client))); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
521 return FALSE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
522 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
523 |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
524 svc_name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local", |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
525 purple_account_get_username(data->account)); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
526 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
527 ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC, |
21696
fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
528 AVAHI_PROTO_INET, flags, svc_name, |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
529 AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 120, avatar_data, avatar_len); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
530 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
531 g_free(svc_name); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
532 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
533 if (ret < 0) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
534 purple_debug_error("bonjour", |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
535 "Failed to register buddy icon. Error: %s\n", avahi_strerror(ret)); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
536 if (new_group) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
537 avahi_entry_group_free(idata->buddy_icon_group); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
538 idata->buddy_icon_group = NULL; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
539 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
540 return FALSE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
541 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
542 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
543 if (new_group && (ret = avahi_entry_group_commit(idata->buddy_icon_group)) < 0) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
544 purple_debug_error("bonjour", |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
545 "Failed to commit buddy icon group. Error: %s\n", avahi_strerror(ret)); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
546 if (new_group) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
547 avahi_entry_group_free(idata->buddy_icon_group); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
548 idata->buddy_icon_group = NULL; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
549 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
550 return FALSE; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
551 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
552 } else if (idata->buddy_icon_group != NULL) { |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
553 purple_debug_info("bonjour", "Removing existing buddy icon.\n"); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
554 avahi_entry_group_free(idata->buddy_icon_group); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
555 idata->buddy_icon_group = NULL; |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
556 } |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
557 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
558 return TRUE; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
559 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
560 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
561 void _mdns_stop(BonjourDnsSd *data) { |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
562 AvahiSessionImplData *idata = data->mdns_impl_data; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
563 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
564 if (idata == NULL || idata->client == NULL) |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
565 return; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
566 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
567 if (idata->sb != NULL) |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
568 avahi_service_browser_free(idata->sb); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
569 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
570 avahi_client_free(idata->client); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
571 avahi_glib_poll_free(idata->glib_poll); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
572 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
573 g_free(idata); |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
574 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
575 data->mdns_impl_data = NULL; |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
576 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
577 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
578 void _mdns_init_buddy(BonjourBuddy *buddy) { |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
579 buddy->mdns_impl_data = g_new0(AvahiBuddyImplData, 1); |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
580 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
581 |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
582 void _mdns_delete_buddy(BonjourBuddy *buddy) { |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
583 AvahiBuddyImplData *idata = buddy->mdns_impl_data; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
584 |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
585 g_return_if_fail(idata != NULL); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
586 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
587 if (idata->buddy_icon_rec_browser != NULL) |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
588 avahi_record_browser_free(idata->buddy_icon_rec_browser); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
589 |
21806
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
590 while(idata->resolvers != NULL) { |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
591 AvahiSvcResolverData *rd = idata->resolvers->data; |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
592 _cleanup_resolver_data(rd); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
593 idata->resolvers = g_slist_delete_link(idata->resolvers, idata->resolvers); |
41959f031322
Update Bonjour prpl to support multiple presence records for the same buddy. Eliminate the Howl backend to avoid having to maintain yet another set of code. References #4187 (more to come to fix the rest of the ticket).
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21696
diff
changeset
|
594 } |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
595 |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
596 g_free(idata); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
597 |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
598 buddy->mdns_impl_data = NULL; |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
599 } |
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
600 |
18849
1787e601aafc
_mdns_retrieve_retrieve_buddy_icon() - what kind of crack am I on anyway?
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18848
diff
changeset
|
601 void _mdns_retrieve_buddy_icon(BonjourBuddy* buddy) { |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
602 PurpleConnection *conn = purple_account_get_connection(buddy->account); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
603 BonjourData *bd = conn->proto_data; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
604 AvahiSessionImplData *session_idata = bd->dns_sd_data->mdns_impl_data; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
605 AvahiBuddyImplData *idata = buddy->mdns_impl_data; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
606 gchar *name; |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
607 |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
608 g_return_if_fail(idata != NULL); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
609 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
610 if (idata->buddy_icon_rec_browser != NULL) |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
611 avahi_record_browser_free(idata->buddy_icon_rec_browser); |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
612 |
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
613 purple_debug_info("bonjour", "Retrieving buddy icon for '%s'.\n", buddy->name); |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
614 |
22052
1be0d49532a1
Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21806
diff
changeset
|
615 name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local", buddy->name); |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
616 idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC, |
21696
fded60f269bc
Don't advertise our presence in avahi on IPv6 or listen for sevices since we don't support receiving connections from or connecting to IPv6 buddies. If someone needs to do that, they can submit a patch. Fixes #4188.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
21527
diff
changeset
|
617 AVAHI_PROTO_INET, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0, |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
618 _buddy_icon_record_cb, buddy); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
619 g_free(name); |
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
620 |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
621 if (!idata->buddy_icon_rec_browser) { |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
622 purple_debug_error("bonjour", |
19654
941965d6fd88
Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
19573
diff
changeset
|
623 "Unable to initialize buddy icon record browser. Error: %s.\n", |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
624 avahi_strerror(avahi_client_errno(session_idata->client))); |
18850
2283d5bfc24b
Implement setting buddy icons for avahi implementation. Fix receiving status changes and some other fixes.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18849
diff
changeset
|
625 } |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
626 |
18805
1244b5f43661
Here is a native avahi implementation of the bonjour prpl that I whipped up. Someone more autofoo savvy will probably want to review what I've done to that stuff. Fixes #326.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
diff
changeset
|
627 } |
18830
2ae9b483c4db
Avahi bonjour implementation of receiving buddy icons.
Daniel Atallah <daniel.atallah@gmail.com>
parents:
18805
diff
changeset
|
628 |