changeset 5068:b37d7d09ec83

[gaim-migrate @ 5419] logout icons committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 07 Apr 2003 23:17:27 +0000
parents bc40b13c83a0
children 8b202bc1a465
files pixmaps/status/default/Makefile.am pixmaps/status/default/logout.png plugins/ticker/ticker.c src/buddy.c src/gtkconv.c src/gtklist.h src/list.c src/list.h src/multi.c src/perl.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/server.c
diffstat 19 files changed, 91 insertions(+), 97 deletions(-) [+]
line wrap: on
line diff
--- a/pixmaps/status/default/Makefile.am	Mon Apr 07 20:08:57 2003 +0000
+++ b/pixmaps/status/default/Makefile.am	Mon Apr 07 23:17:27 2003 +0000
@@ -1,9 +1,9 @@
-EXTRA_DIST = login.png aim.png icq.png msn.png jabber.png yahoo.png gadu-gadu.png napster.png irc.png \
+EXTRA_DIST = login.png logout.png aim.png icq.png msn.png jabber.png yahoo.png gadu-gadu.png napster.png irc.png \
 	     activebuddy.png admin.png aol.png away.png wireless.png offline.png \
 	     dnd.png freeforchat.png invisible.png na.png occupied.png game.png
 
 gaimstatuspixdir = $(datadir)/pixmaps/gaim/status/default
 
-gaimstatuspix_DATA = login.png aim.png icq.png msn.png jabber.png yahoo.png gadu-gadu.png napster.png irc.png \
+gaimstatuspix_DATA = login.png logout.png aim.png icq.png msn.png jabber.png yahoo.png gadu-gadu.png napster.png irc.png \
 		     activebuddy.png admin.png aol.png away.png wireless.png offline.png \
 		     dnd.png freeforchat.png invisible.png na.png occupied.png game.png
Binary file pixmaps/status/default/logout.png has changed
--- a/plugins/ticker/ticker.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/plugins/ticker/ticker.c	Mon Apr 07 23:17:27 2003 +0000
@@ -361,7 +361,7 @@
 		g = (struct group *)grps->data;
 		for( buds = g->members; buds; buds = buds->next ) {
 			b = (struct buddy *)buds->data;
-			if( b->present ) {
+			if(GAIM_BUDDY_IS_ONLINE(b)) {
 				xpm = NULL;
 				if (b->account->gc->prpl->list_icon)
 					xpm = b->account->gc->prpl->list_icon(b->account, b);
--- a/src/buddy.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/buddy.c	Mon Apr 07 23:17:27 2003 +0000
@@ -411,19 +411,6 @@
 	gaim_gtk_blist_refresh(gaim_get_blist());
 }
 
-/* This is called 10 seconds after the buddy logs in.  It removes the "logged in" icon and replaces it with
- * the normal status icon. Make sure they didn't sign off in the mean-time though. */
-
-static gboolean gaim_reset_present_icon (GaimBlistNode *b)
-{
-	if (((struct buddy *)b)->present == 2) {
-		((struct buddy *)b)->present = 1;
-		gaim_gtk_blist_update(NULL, b);
-	}
-
-	return FALSE;
-}
-
 static void gaim_gtk_blist_drag_data_get_cb (GtkWidget *widget,
 					     GdkDragContext *dc,
 					     GtkSelectionData *data,
@@ -742,7 +729,7 @@
 			       nicktext ? _("\n<b>Nickname:</b>") : "", nicktext ? nicktext : "",
 			       idletime ? _("\n<b>Idle:</b>") : "", idletime ? idletime : "",
 			       b->evil ? _("\n<b>Warned:</b>") : "", b->evil ? warning : "",
-			       !b->present ? _("\n<b>Status:</b> Offline") : "",
+			       !GAIM_BUDDY_IS_ONLINE(b) ? _("\n<b>Status:</b> Offline") : "",
 			       statustext ? "\n" : "", statustext ? statustext : "",
 				   !g_ascii_strcasecmp(b->name, "robflynn") ? "\n<b>Description:</b> Spooky" : "");
 	
@@ -761,7 +748,7 @@
 
 }
 
-static GdkPixbuf *gaim_gtk_blist_get_status_icon(struct buddy *b, GaimStatusIconSize size) 
+static GdkPixbuf *gaim_gtk_blist_get_status_icon(struct buddy *b, GaimStatusIconSize size)
 {
 	GdkPixbuf *status = NULL;
 	GdkPixbuf *scale = NULL;
@@ -780,27 +767,23 @@
 
 	if (prpl->list_icon)
 		protoname = prpl->list_icon(b->account, b);
-	if (prpl->list_emblems)
+	if (b->present != GAIM_BUDDY_SIGNING_OFF && prpl->list_emblems)
 		prpl->list_emblems(b, &se, &sw, &nw, &ne);
-	
+
 	if (size == GAIM_STATUS_ICON_SMALL) {
 		scalesize = 15;
 		sw = nw = ne = NULL; /* So that only the se icon will composite */
 	}
 
 
-	if (b->present == 2) {
-		struct gaim_gtk_blist_node *gtknode;
-		/* If b->present is 2, that means this buddy has just signed on.  We use the "login" icon for the
-		 * status, and we set a timeout to change it to a normal icon after 10 seconds. */
+	if (b->present == GAIM_BUDDY_SIGNING_ON) {
 		filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "login.png", NULL);
 		status = gdk_pixbuf_new_from_file(filename,NULL);
 		g_free(filename);
-
-		gtknode = GAIM_GTK_BLIST_NODE((GaimBlistNode*)b);
-		if (gtknode->timer > 0)
-			g_source_remove(gtknode->timer);
-		gtknode->timer = g_timeout_add(10000, (GSourceFunc)gaim_reset_present_icon, b);
+	} else if (b->present == GAIM_BUDDY_SIGNING_OFF) {
+		filename = g_build_filename(DATADIR, "pixmaps", "gaim", "status", "default", "logout.png", NULL);
+		status = gdk_pixbuf_new_from_file(filename,NULL);
+		g_free(filename);
 
 		/* "Hey, what's all this crap?" you ask.  Status icons will be themeable too, and
 		   then it will look up protoname from the theme */
@@ -906,7 +889,7 @@
 
 
 	/* Idle grey buddies affects the whole row.  This converts the status icon to greyscale. */
-	if (!b->present)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.0, FALSE);
 	else if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS)
 		gdk_pixbuf_saturate_and_pixelate(scale, scale, 0.25, FALSE);
@@ -930,7 +913,7 @@
 
 
 	if (buf) {
-		if (!b->present)
+		if (!GAIM_BUDDY_IS_ONLINE(b))
 			gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.0, FALSE);
 		if (b->idle && blist_options & OPT_BLIST_GREY_IDLERS)
 			gdk_pixbuf_saturate_and_pixelate(buf, buf, 0.25, FALSE);
@@ -955,7 +938,7 @@
 	time_t t;
 
 	if (!(blist_options & OPT_BLIST_SHOW_ICONS)) {
-		if ((b->idle && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || b->present == 0) {
+		if ((b->idle && blist_options & OPT_BLIST_GREY_IDLERS && !selected) || !GAIM_BUDDY_IS_ONLINE(b)) {
 			text =  g_strdup_printf("<span color='dim grey'>%s</span>",
 						esc);
 			g_free(esc);
@@ -1026,8 +1009,8 @@
 					statustext != NULL ? statustext : "",
 					idletime != NULL ? idletime : "", 
 					warning != NULL ? warning : "",
-					!b->present ? _("Offline ") : "");
-	} else if (statustext == NULL && idletime == NULL && warning == NULL && b->present) {
+					!GAIM_BUDDY_IS_ONLINE(b) ? _("Offline ") : "");
+	} else if (statustext == NULL && idletime == NULL && warning == NULL && GAIM_BUDDY_IS_ONLINE(b)) {
 		text = g_strdup(esc);
 	} else {
 		text = g_strdup_printf("%s\n"
@@ -1036,7 +1019,7 @@
 				       statustext != NULL ? statustext :  "",
 				       idletime != NULL ? idletime : "", 
 				       warning != NULL ? warning : "",
-				       !b->present ? _("Offline ") : "");
+				       !GAIM_BUDDY_IS_ONLINE(b) ? _("Offline ") : "");
 	}
 	if (idletime)
 		g_free(idletime);
@@ -1100,11 +1083,6 @@
 	blist->ui_data = g_new0(struct gaim_gtk_buddy_list, 1);
 }
 
-static void gaim_gtk_blist_new_node(GaimBlistNode *node)
-{
-	node->ui_data = g_new0(struct gaim_gtk_blist_node, 1);
-}
-
 void gaim_gtk_blist_update_columns()
 {
 	if (blist_options & OPT_BLIST_SHOW_ICONS) {
@@ -1400,19 +1378,8 @@
 
 static void gaim_gtk_blist_remove(struct gaim_buddy_list *list, GaimBlistNode *node)
 {
-	struct gaim_gtk_blist_node *gtknode;
 	GtkTreeIter iter;
 
-	if (!node->ui_data)
-		return;
-
-	gtknode = (struct gaim_gtk_blist_node *)node->ui_data;
-
-	if (gtknode->timer > 0) {
-		g_source_remove(gtknode->timer);
-		gtknode->timer = 0;
-	}
-
 	/* For some reason, we're called before we have a buddy list sometimes */
 	if(!gtkblist)
 		return;
@@ -1489,7 +1456,6 @@
 
 static void gaim_gtk_blist_update(struct gaim_buddy_list *list, GaimBlistNode *node)
 {
-	struct gaim_gtk_blist_node *gtknode;
 	GtkTreeIter iter;
 	GtkTreePath *expand = NULL;
 	gboolean new_entry = FALSE;
@@ -1497,13 +1463,10 @@
 	if (!gtkblist)
 		return;
 
-	gtknode = GAIM_GTK_BLIST_NODE(node);
-
-
 	if (!get_iter_from_node(node, &iter)) { /* This is a newly added node */
 		new_entry = TRUE;
 		if (GAIM_BLIST_NODE_IS_BUDDY(node)) {
-			if (((struct buddy*)node)->present || ((blist_options & OPT_BLIST_SHOW_OFFLINE) && ((struct buddy*)node)->account->gc)) {
+			if (((struct buddy*)node)->present != GAIM_BUDDY_OFFLINE || ((blist_options & OPT_BLIST_SHOW_OFFLINE) && ((struct buddy*)node)->account->gc)) {
 				GtkTreeIter groupiter;
 				GaimBlistNode *oldersibling;
 				GtkTreeIter oldersiblingiter;
@@ -1556,7 +1519,7 @@
 		}
 	}
 
-	if (GAIM_BLIST_NODE_IS_BUDDY(node) && (((struct buddy*)node)->present || ((blist_options & OPT_BLIST_SHOW_OFFLINE) && ((struct buddy*)node)->account->gc))) {
+	if (GAIM_BLIST_NODE_IS_BUDDY(node) && (((struct buddy*)node)->present != GAIM_BUDDY_OFFLINE || ((blist_options & OPT_BLIST_SHOW_OFFLINE) && ((struct buddy*)node)->account->gc))) {
 		GdkPixbuf *status, *avatar;
 		char *mark;
 		char *warning = NULL, *idle = NULL;
@@ -1745,7 +1708,7 @@
 static struct gaim_blist_ui_ops blist_ui_ops =
 {
 	gaim_gtk_blist_new_list,
-	gaim_gtk_blist_new_node,
+	NULL,
 	gaim_gtk_blist_show,
 	gaim_gtk_blist_update,
 	gaim_gtk_blist_remove,
--- a/src/gtkconv.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/gtkconv.c	Mon Apr 07 23:17:27 2003 +0000
@@ -2239,7 +2239,7 @@
 					continue;
 				buddy = (struct buddy *)bnode;
 
-				if (buddy->account == gc->account && buddy->present)
+				if (buddy->account == gc->account && GAIM_BUDDY_IS_ONLINE(buddy))
 					tmp = g_list_append(tmp, buddy->name);
 			}
 		}
--- a/src/gtklist.h	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/gtklist.h	Mon Apr 07 23:17:27 2003 +0000
@@ -72,15 +72,6 @@
 	GaimBlistNode *selected_node;   /**< The currently selected node */
 };
 
-/**
- * A GTK+ buddy list node.
- */
-struct gaim_gtk_blist_node
-{
-	unsigned int timer;                      /**< The timer handle.  */
-};
-
-#define GAIM_GTK_BLIST_NODE(node) ((struct gaim_gtk_blist_node *)(node)->ui_data)
 #define GAIM_GTK_BLIST(list) ((struct gaim_gtk_buddy_list *)(list)->ui_data)
 #define GAIM_IS_GTK_BLIST(list) \
 	((list)->ui_ops == gaim_get_gtk_blist_ui_ops())
--- a/src/list.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/list.c	Mon Apr 07 23:17:27 2003 +0000
@@ -122,13 +122,40 @@
 		ops->update(gaimbuddylist, (GaimBlistNode*)buddy);
 }
 
-void gaim_blist_update_buddy_presence(struct buddy *buddy, int presence) {
+static gboolean presence_update_timeout_cb(struct buddy *buddy) {
 	struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops;
 
-	if (!buddy->present && presence)
-		buddy->present = 2;
-	else if (buddy->present != 2 || !presence)
-		buddy->present = presence;
+	if(buddy->present == GAIM_BUDDY_SIGNING_ON)
+		buddy->present = GAIM_BUDDY_ONLINE;
+	else if(buddy->present == GAIM_BUDDY_SIGNING_OFF)
+		buddy->present = GAIM_BUDDY_OFFLINE;
+
+	buddy->timer = 0;
+
+	if (ops)
+		ops->update(gaimbuddylist, (GaimBlistNode*)buddy);
+
+	return FALSE;
+}
+
+void gaim_blist_update_buddy_presence(struct buddy *buddy, int presence) {
+	struct gaim_blist_ui_ops *ops = gaimbuddylist->ui_ops;
+	gboolean do_timer = FALSE;
+
+	if (!GAIM_BUDDY_IS_ONLINE(buddy) && presence) {
+		buddy->present = GAIM_BUDDY_SIGNING_ON;
+		do_timer = TRUE;
+	} else if(GAIM_BUDDY_IS_ONLINE(buddy) && !presence) {
+		buddy->present = GAIM_BUDDY_SIGNING_OFF;
+		do_timer = TRUE;
+	}
+
+	if(do_timer) {
+		if(buddy->timer > 0)
+			g_source_remove(buddy->timer);
+		buddy->timer = g_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy);
+	}
+
 	if (ops)
 		ops->update(gaimbuddylist, (GaimBlistNode*)buddy);
 }
@@ -484,7 +511,7 @@
 		buddy = group->child;
 		while (buddy) {
 			if (account == ((struct buddy*)buddy)->account) {
-				((struct buddy*)buddy)->present = 0;
+				((struct buddy*)buddy)->present = GAIM_BUDDY_OFFLINE;
 				if(ops)
 					ops->remove(gaimbuddylist, buddy);
 			}
@@ -1419,7 +1446,7 @@
 	for(node = group->node.child; node; node = node->next) {
 		if(GAIM_BLIST_NODE_IS_BUDDY(node)) {
 			struct buddy *b = (struct buddy *)node;
-			if(b->present)
+			if(GAIM_BUDDY_IS_ONLINE(b))
 				count++;
 		}
 	}
--- a/src/list.h	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/list.h	Mon Apr 07 23:17:27 2003 +0000
@@ -40,6 +40,17 @@
 #define GAIM_BLIST_NODE_IS_BUDDY(n) ((n)->type == GAIM_BLIST_BUDDY_NODE)
 #define GAIM_BLIST_NODE_IS_GROUP(n) ((n)->type == GAIM_BLIST_GROUP_NODE)
 
+enum gaim_buddy_presence_state {
+	GAIM_BUDDY_SIGNING_OFF = -1,
+	GAIM_BUDDY_OFFLINE = 0,
+	GAIM_BUDDY_ONLINE,
+	GAIM_BUDDY_SIGNING_ON,
+};
+
+#define GAIM_BUDDY_IS_ONLINE(b) ((b)->present == GAIM_BUDDY_ONLINE || \
+		(b)->present == GAIM_BUDDY_SIGNING_ON)
+
+
 /**************************************************************************/
 /* Data Structures                                                        */
 /**************************************************************************/
@@ -52,7 +63,7 @@
 	enum gaim_blist_node_type type;        /**< The type of node this is       */
 	GaimBlistNode *prev;                   /**< The sibling before this buddy. */
 	GaimBlistNode *next;                   /**< The sibling after this buddy.  */
-        GaimBlistNode *parent;                 /**< The parent of this node        */
+	GaimBlistNode *parent;                 /**< The parent of this node        */
 	GaimBlistNode *child;                  /**< The child of this node         */
 	void          *ui_data;                /**< The UI can put data here.      */
 };
@@ -65,15 +76,16 @@
 	char *name;                             /**< The screenname of the buddy. */
 	char *alias;                            /**< The user-set alias of the buddy */
 	char *server_alias;                     /**< The server-specified alias of the buddy.  (i.e. MSN "Friendly Names") */ 
-	int present;                            /**< This is 0 if the buddy appears offline, 1 if he appears online, and 2 if
+	enum gaim_buddy_presence_state present;                            /**< This is 0 if the buddy appears offline, 1 if he appears online, and 2 if
 						    he has recently signed on */
 	int evil;                               /**< The warning level */
 	time_t signon;                          /**< The time the buddy signed on. */
 	int idle;                               /**< The time the buddy has been idle in minutes. */
-        int uc;                                 /**< This is a cryptic bitmask that makes sense only to the prpl.  This will get changed */
+	int uc;                                 /**< This is a cryptic bitmask that makes sense only to the prpl.  This will get changed */
 	void *proto_data;                       /**< This allows the prpl to associate whatever data it wants with a buddy */
 	struct gaim_account *account;           /**< the account this buddy belongs to */ 
 	GHashTable *settings;                   /**< per-buddy settings from the XML buddy list, set by plugins and the likes. */
+	guint timer;							/**< The timer handle. */
 };
 
 /**
--- a/src/multi.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/multi.c	Mon Apr 07 23:17:27 2003 +0000
@@ -171,7 +171,7 @@
 				continue;
 			n = (struct buddy *)bnode;
 			if(n->account == gc->account) {
-				n->present = 0;
+				n->present = GAIM_BUDDY_OFFLINE;
 			}
 		}
 	}
--- a/src/perl.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/perl.c	Mon Apr 07 23:17:27 2003 +0000
@@ -712,7 +712,7 @@
 			if(!GAIM_BLIST_NODE_IS_BUDDY(bnode))
 				continue;
 			b = (struct buddy *)bnode;
-			if (b->account == gc->account && b->present) XST_mPV(i++, b->name);
+			if (b->account == gc->account && GAIM_BUDDY_IS_ONLINE(b)) XST_mPV(i++, b->name);
 		}
 	}
 	XSRETURN(i);
@@ -785,7 +785,7 @@
 		XSRETURN(0);
 	XST_mPV(0, buddy->name);
 	XST_mPV(1, gaim_get_buddy_alias(buddy));
-	XST_mPV(2, buddy->present ? "Online" : "Offline");
+	XST_mPV(2, GAIM_BUDDY_IS_ONLINE(buddy) ? "Online" : "Offline");
 	XST_mIV(3, buddy->evil);
 	XST_mIV(4, buddy->signon);
 	XST_mIV(5, buddy->idle);
--- a/src/protocols/gg/gg.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/gg/gg.c	Mon Apr 07 23:17:27 2003 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 5250 2003-03-31 07:19:46Z seanegan $
+ * $Id: gg.c 5419 2003-04-07 23:17:27Z faceprint $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -1251,7 +1251,7 @@
 static void agg_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
 {
 	int status;
-	if (b->present == 0)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		*se = "offline";
 	else if (b->uc == UC_UNAVAILABLE)
 		*se = "away";
--- a/src/protocols/irc/irc.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/irc/irc.c	Mon Apr 07 23:17:27 2003 +0000
@@ -600,9 +600,9 @@
 				l = x + strlen(b->name);
 				if (x && (*l != ' ' && *l != 0))
 					x = 0;
-				if (!b->present && x)
+				if (!GAIM_BUDDY_IS_ONLINE(b) && x)
 					serv_got_update(gc, b->name, 1, 0, 0, 0, 0);
-				else if (b->present && !x)
+				else if (GAIM_BUDDY_IS_ONLINE(b) && !x)
 					serv_got_update(gc, b->name, 0, 0, 0, 0, 0);
 				g_free(tmp);
 			}
@@ -2458,7 +2458,7 @@
 
 static void irc_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
 {
-	if (b->present == 0)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		*se = "offline";
 }
 
--- a/src/protocols/jabber/jabber.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Mon Apr 07 23:17:27 2003 +0000
@@ -1784,13 +1784,14 @@
 				int signon = b->signon;
 
 				/*
+				 * FIXME: this ugly hack is no longer needed
 				 * seems rude, but it seems to be the only way...
 				 */
 				gaim_blist_remove_buddy(b);
 				b = gaim_buddy_new(GJ_GC(gjc)->account, buddyname, name);
 				gaim_blist_add_buddy(b, gaim_find_group(groupname), NULL);
 				gaim_blist_save();
-				if(present) {
+				if(present > 0) {
 					serv_got_update(GJ_GC(gjc), buddyname, 1, 0, signon, idle,
 							uc);
 				}
@@ -2789,7 +2790,7 @@
 		}
 	}
 
-	if (b->present == 0) {
+	if (b->present == GAIM_BUDDY_OFFLINE) {
 		*se = "offline";
 	} else {
 		switch (b->uc) {
--- a/src/protocols/msn/msn.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/msn/msn.c	Mon Apr 07 23:17:27 2003 +0000
@@ -1593,7 +1593,7 @@
 
 static void msn_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
 {
-	if (b->present == 0)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		*se = "offline";
 	else if (b->uc >> 1 == 2 || b->uc >> 1 == 6)
 		*se = "occupied";
@@ -1643,7 +1643,7 @@
 }
 
 static char *msn_tooltip_text(struct buddy *b) {
-	if (b->present)
+	if (GAIM_BUDDY_IS_ONLINE(b))
 		return g_strdup_printf(_("<b>Status:</b> %s"), msn_get_away_text(b->uc >> 1));
 
 	return NULL;
--- a/src/protocols/napster/napster.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/napster/napster.c	Mon Apr 07 23:17:27 2003 +0000
@@ -559,7 +559,7 @@
 
 static void nap_list_emblems(struct buddy *b, char **se, char **sw, char **nw, char **ne)
 {
-	if (b->present == 0)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		*se = "offline";
 }
 
--- a/src/protocols/oscar/oscar.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Mon Apr 07 23:17:27 2003 +0000
@@ -5148,7 +5148,7 @@
 	char *emblems[4] = {NULL,NULL,NULL,NULL};
 	int i = 0;
 
-	if (b->present == 0)
+	if (b->present == GAIM_BUDDY_OFFLINE)
 		emblems[i++] = "offline";
 
 	if (b->name && (b->uc & 0xffff0000) && isdigit(b->name[0])) {
@@ -5512,7 +5512,7 @@
 	} else {
 		struct buddy *b = gaim_find_buddy(gc->account, who);
 
-		if ((aim_sncmp(gc->username, who)) && b->present) {
+		if ((aim_sncmp(gc->username, who)) && GAIM_BUDDY_IS_ONLINE(b)) {
 			pbm = g_new0(struct proto_buddy_menu, 1);
 			pbm->label = _("Direct IM");
 			pbm->callback = oscar_ask_direct_im;
--- a/src/protocols/toc/toc.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/toc/toc.c	Mon Apr 07 23:17:27 2003 +0000
@@ -1288,7 +1288,7 @@
 	char *emblems[4] = {NULL,NULL,NULL,NULL};
 	int i = 0;
 
-	if (b->present == 0) {
+	if (b->present == GAIM_BUDDY_OFFLINE) {
 		*se = "offline";
 		return;
 	} else {
--- a/src/protocols/yahoo/yahoo.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Mon Apr 07 23:17:27 2003 +0000
@@ -1022,7 +1022,7 @@
 {
 	int i = 0;
 	char *emblems[4] = {NULL,NULL,NULL,NULL};
-	if (b->present == 0) {
+	if (b->present == GAIM_BUDDY_OFFLINE) {
 		*se = "offline";
 		return;
 	} else {
--- a/src/server.c	Mon Apr 07 20:08:57 2003 +0000
+++ b/src/server.c	Mon Apr 07 23:17:27 2003 +0000
@@ -893,7 +893,7 @@
 	
 
 	if (loggedin) {
-		if (!b->present == 1) {
+		if (!GAIM_BUDDY_IS_ONLINE(b)) {
 			struct gaim_conversation *c = gaim_find_conversation(b->name);
 			if (c && (im_options & OPT_IM_LOGON)) {
 				char *tmp = g_strdup_printf(_("%s logged in."), gaim_get_buddy_alias(b));
@@ -917,7 +917,7 @@
 			system_log(log_signon, gc, b, OPT_LOG_BUDDY_SIGNON);
 		}
 	} else {
-		if (b->present == 1) {
+		if (GAIM_BUDDY_IS_ONLINE(b)) {
 			struct gaim_conversation *c = gaim_find_conversation(b->name);
 			if (c && (im_options & OPT_IM_LOGON)) {
 				char *tmp = g_strdup_printf(_("%s logged out."), gaim_get_buddy_alias(b));