diff src/server.c @ 3815:b2ec492c9afe

[gaim-migrate @ 3962] Thanks Joshua Blanton. The ChangeLog is getting REALLY huge. Remember when Gaim used to have "releases"? committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Tue, 29 Oct 2002 05:57:55 +0000
parents 2567aabdf624
children 30f52e7afd1d
line wrap: on
line diff
--- a/src/server.c	Tue Oct 29 05:52:51 2002 +0000
+++ b/src/server.c	Tue Oct 29 05:57:55 2002 +0000
@@ -182,6 +182,13 @@
 	else return 0;
 }
 
+struct queued_away_response {
+	char name[80];
+	time_t sent_away;
+};
+
+struct queued_away_response *find_queued_away_response_by_name(char *name);
+
 int serv_send_im(struct gaim_connection *gc, char *name, char *message, int len, int flags)
 {
 	int val = -EINVAL;
@@ -192,6 +199,21 @@
 	if (!(flags & IM_FLAG_AWAY))
 		serv_touch_idle(gc);
 
+	if (gc->away && away_options & OPT_AWAY_DELAY_IN_USE &&
+			!(away_options & OPT_AWAY_NO_AUTO_RESP)) {
+		time_t t;
+		struct queued_away_response *qar;
+		time(&t);
+		qar = find_queued_away_response_by_name(name);
+		if (!qar) {
+			qar = (struct queued_away_response *)g_new0(struct queued_away_response, 1);
+			g_snprintf(qar->name, sizeof(qar->name), "%s", name);
+			qar->sent_away = 0;
+			away_time_queue = g_slist_append(away_time_queue, qar);
+		}
+		qar->sent_away = t;
+	}
+
 	if (cnv && cnv->type_again_timeout)
 		gtk_timeout_remove(cnv->type_again_timeout);
 
@@ -500,11 +522,6 @@
 	return i;
 }
 
-struct queued_away_response {
-	char name[80];
-	time_t sent_away;
-};
-
 struct queued_away_response *find_queued_away_response_by_name(char *name)
 {
 	GSList *templist;