comparison libpurple/protocols/bonjour/mdns_howl.c @ 18843:7bf6b9a70b41

Some more minor mdns implementation abstraction tweaks and implementation of setting buddy icons for the win32 bonjour implementation.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 08 Aug 2007 01:50:01 +0000
parents b839f427cbb2
children 09f52521ff5b
comparison
equal deleted inserted replaced
18841:03a0054954bb 18843:7bf6b9a70b41
24 24
25 /* data used by howl bonjour implementation */ 25 /* data used by howl bonjour implementation */
26 typedef struct _howl_impl_data { 26 typedef struct _howl_impl_data {
27 sw_discovery session; 27 sw_discovery session;
28 sw_discovery_oid session_id; 28 sw_discovery_oid session_id;
29 guint session_handler;
29 } HowlSessionImplData; 30 } HowlSessionImplData;
30 31
31 static sw_result HOWL_API 32 static sw_result HOWL_API
32 _publish_reply(sw_discovery discovery, sw_discovery_oid oid, 33 _publish_reply(sw_discovery discovery, sw_discovery_oid oid,
33 sw_discovery_publish_status status, sw_opaque extra) 34 sw_discovery_publish_status status, sw_opaque extra)
274 /* TODO: don't we need to hang onto this to cancel later? */ 275 /* TODO: don't we need to hang onto this to cancel later? */
275 sw_discovery_oid session_id; 276 sw_discovery_oid session_id;
276 277
277 g_return_val_if_fail(idata != NULL, FALSE); 278 g_return_val_if_fail(idata != NULL, FALSE);
278 279
279 return (sw_discovery_browse(idata->session, 0, ICHAT_SERVICE, NULL, _browser_reply, 280 if (sw_discovery_browse(idata->session, 0, ICHAT_SERVICE, NULL, _browser_reply,
280 data->account, &session_id) == SW_OKAY); 281 data->account, &session_id) == SW_OKAY) {
281 } 282 idata->session_handler = purple_input_add(sw_discovery_socket(idata->session),
282
283 guint _mdns_register_to_mainloop(BonjourDnsSd *data) {
284 HowlSessionImplData *idata = data->mdns_impl_data;
285
286 g_return_val_if_fail(idata != NULL, 0);
287
288 return purple_input_add(sw_discovery_socket(idata->session),
289 PURPLE_INPUT_READ, _mdns_handle_event, idata->session); 283 PURPLE_INPUT_READ, _mdns_handle_event, idata->session);
290 } 284 return TRUE;
285 }
286
287 return FALSE;
288 }
289
290 void _mdns_set_buddy_icon_data(BonjourDnsSd *data, gconstpointer avatar_data, gsize avatar_len) {
291 }
292
291 293
292 void _mdns_stop(BonjourDnsSd *data) { 294 void _mdns_stop(BonjourDnsSd *data) {
293 HowlSessionImplData *idata = data->mdns_impl_data; 295 HowlSessionImplData *idata = data->mdns_impl_data;
294 296
295 if (idata == NULL || idata->session == NULL) 297 if (idata == NULL || idata->session == NULL)
296 return; 298 return;
297 299
298 sw_discovery_cancel(idata->session, idata->session_id); 300 sw_discovery_cancel(idata->session, idata->session_id);
299 301
302 purple_input_remove(idata->session_handler);
303
300 /* TODO: should this really be g_free()'d ??? */ 304 /* TODO: should this really be g_free()'d ??? */
301 g_free(idata->session); 305 g_free(idata->session);
302 306
303 g_free(idata); 307 g_free(idata);
304 308
311 void _mdns_delete_buddy(BonjourBuddy *buddy) { 315 void _mdns_delete_buddy(BonjourBuddy *buddy) {
312 } 316 }
313 317
314 void bonjour_dns_sd_retrieve_buddy_icon(BonjourBuddy* buddy) { 318 void bonjour_dns_sd_retrieve_buddy_icon(BonjourBuddy* buddy) {
315 } 319 }
320
321