changeset 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 c56115a38aa0
children b983234cb3a3
files ChangeLog src/gaim.h src/prefs.c src/server.c
diffstat 4 files changed, 25 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Oct 29 05:52:51 2002 +0000
+++ b/ChangeLog	Tue Oct 29 05:57:55 2002 +0000
@@ -99,7 +99,7 @@
 	  format (Thanks Robert McQueen).
 	* Allow only people in buddy list privacy option added for AIM
 	* Optional password on IRC accounts (Thanks, Christian Hammond)
-
+	* Better supression of auto-responses (Thanks Joshua Blanton)
 version 0.59 (06/24/2002):
 	* Hungarian translation added (Thanks, Sutto Zoltan)
 	* Swedish translation updated (Thanks, Christian Rose)
--- a/src/gaim.h	Tue Oct 29 05:52:51 2002 +0000
+++ b/src/gaim.h	Tue Oct 29 05:57:55 2002 +0000
@@ -340,6 +340,7 @@
 #define OPT_AWAY_QUEUE			0x00000020
 #define OPT_AWAY_IDLE_RESP		0x00000040
 #define OPT_AWAY_QUEUE_UNREAD           0x00000080
+#define OPT_AWAY_DELAY_IN_USE		0x00000100
 
 extern guint away_resend;
 extern int report_idle;
--- a/src/prefs.c	Tue Oct 29 05:52:51 2002 +0000
+++ b/src/prefs.c	Tue Oct 29 05:57:55 2002 +0000
@@ -819,6 +819,7 @@
 				 &away_resend_new, 1, 24 * 60 * 60, sg);
 	gaim_button(_("_Don't send auto-response"), &away_options_new, OPT_AWAY_NO_AUTO_RESP, vbox);
 	gaim_button(_("_Only send auto-response when idle"), &away_options_new, OPT_AWAY_IDLE_RESP, vbox);
+	gaim_button(_("Do_n't send auto-response in active conversations"), &away_options_new, OPT_AWAY_DELAY_IN_USE, vbox);
 
 	if (away_options_new & OPT_AWAY_NO_AUTO_RESP)
 		gtk_widget_set_sensitive(hbox, FALSE);
--- 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;