diff src/multi.c @ 4890:89cb14edf8cf

[gaim-migrate @ 5220] Moved utility function declarations into util.h and documented them. Constificationized some vars in some functions. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 25 Mar 2003 06:26:24 +0000
parents ac9ed6c5594f
children b6fd57ba76e8
line wrap: on
line diff
--- a/src/multi.c	Tue Mar 25 05:01:00 2003 +0000
+++ b/src/multi.c	Tue Mar 25 06:26:24 2003 +0000
@@ -1517,6 +1517,38 @@
 	}
 }
 
+void away_on_login(char *mesg)
+{
+	GSList *awy = away_messages;
+	struct away_message *a, *message = NULL;
+	struct gaim_gtk_buddy_list *gtkblist;
+
+	gtkblist = GAIM_GTK_BLIST(gaim_get_blist());
+
+	if (!gtkblist->window) {
+		return;
+	}
+
+	if (mesg == NULL) {
+		/* Use default message */
+		do_away_message(NULL, default_away);
+	} else {
+		/* Use argument */
+		while (awy) {
+			a = (struct away_message *)awy->data;
+			if (strcmp(a->name, mesg) == 0) {
+				message = a;
+				break;
+			}
+			awy = awy->next;
+		}
+		if (message == NULL)
+			message = default_away;
+		do_away_message(NULL, message);
+	}
+	return;
+}
+
 void account_online(struct gaim_connection *gc)
 {
 	struct signon_meter *meter = find_signon_meter(gc);