comparison src/protocols/bonjour/bonjour.c @ 12339:fdac1c5e6c68

[gaim-migrate @ 14643] Don't show offline bonjour uses as away. Of course, the only time you would ever have an offline bonjour user is if you add some random person to your buddy list committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 05 Dec 2005 03:42:48 +0000
parents 4d3119205a33
children 488a305f9aff
comparison
equal deleted inserted replaced
12338:1f6aac820540 12339:fdac1c5e6c68
37 #include "bonjour.h" 37 #include "bonjour.h"
38 #include "dns_sd.h" 38 #include "dns_sd.h"
39 #include "jabber.h" 39 #include "jabber.h"
40 #include "buddy.h" 40 #include "buddy.h"
41 41
42 /*
43 * TODO: Should implement an add_buddy callback that removes the buddy
44 * from the local list. Bonjour manages buddies for you, and
45 * adding someone locally by hand is stupid.
46 */
47
42 static char *default_firstname; 48 static char *default_firstname;
43 static char *default_lastname; 49 static char *default_lastname;
44 static char *default_hostname; 50 static char *default_hostname;
45 51
46 static void 52 static void
279 { 285 {
280 GaimPresence *presence; 286 GaimPresence *presence;
281 287
282 presence = gaim_buddy_get_presence(buddy); 288 presence = gaim_buddy_get_presence(buddy);
283 289
284 if (!gaim_presence_is_available(presence)) 290 if (gaim_presence_is_online(presence) && !gaim_presence_is_available(presence))
285 *se = "away"; 291 *se = "away";
286 } 292 }
287 293
288 static char * 294 static char *
289 bonjour_status_text(GaimBuddy *buddy) 295 bonjour_status_text(GaimBuddy *buddy)
290 { 296 {
291 GaimPresence *presence; 297 GaimPresence *presence;
292 298
293 presence = gaim_buddy_get_presence(buddy); 299 presence = gaim_buddy_get_presence(buddy);
294 300
295 if (gaim_presence_is_available(presence)) 301 if (gaim_presence_is_online(presence) && !gaim_presence_is_available(presence))
296 return g_strdup("");
297 else
298 return g_strdup("Away"); 302 return g_strdup("Away");
303
304 return NULL;
299 } 305 }
300 306
301 static char * 307 static char *
302 bonjour_tooltip_text(GaimBuddy *buddy) 308 bonjour_tooltip_text(GaimBuddy *buddy)
303 { 309 {