changeset 8948:175cbf710a47

[gaim-migrate @ 9720] Eradicate the "seconds before resending autoresponse" preference (default to 600 seconds) and the "send autoresponse in active conversations" preference (default to no) committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 16 May 2004 06:39:51 +0000
parents fa6c2d893c51
children dfa1cd98d1c7
files src/gaimrc.c src/gtkprefs.c src/prefs.c src/server.c
diffstat 4 files changed, 9 insertions(+), 46 deletions(-) [+]
line wrap: on
line diff
--- a/src/gaimrc.c	Sun May 16 06:12:03 2004 +0000
+++ b/src/gaimrc.c	Sun May 16 06:39:51 2004 +0000
@@ -1122,10 +1122,6 @@
 					away_options & OPT_AWAY_IDLE_RESP);
 			gaim_prefs_set_bool("/plugins/gtk/docklet/queue_messages",
 					away_options & OPT_AWAY_QUEUE_UNREAD);
-			gaim_prefs_set_bool("/core/away/auto_response/in_active_conv",
-					!(away_options & OPT_AWAY_DELAY_IN_USE));
-			gaim_prefs_set_int("/core/away/auto_response/sec_before_resend",
-					atoi(p->value[1]));
 		} else if (!strcmp(p->option, "font_face")) {
 			gaim_prefs_set_string("/gaim/gtk/conversations/font_face",
 								  p->value[0]);
--- a/src/gtkprefs.c	Sun May 16 06:12:03 2004 +0000
+++ b/src/gtkprefs.c	Sun May 16 06:39:51 2004 +0000
@@ -1554,18 +1554,6 @@
 	return ret;
 }
 
-#if 0 /* PREFSLASH04 */
-static void
-auto_resp_changed_cb(const char *name, GaimPrefType type, gpointer value,
-		gpointer data)
-{
-	GtkWidget *hbox = data;
-	gboolean enabled = GPOINTER_TO_INT(value);
-
-	gtk_widget_set_sensitive(hbox, enabled);
-}
-#endif /* PREFSLASH04 */
-
 GtkWidget *away_page() {
 	GtkWidget *ret;
 	GtkWidget *vbox;
@@ -1586,26 +1574,10 @@
 				   "/gaim/gtk/away/queue_messages", vbox);
 
 	vbox = gaim_gtk_make_frame (ret, _("Auto-response"));
-#if 0 /* PREFSLASH04 */
-	  hbox = gtk_hbox_new(FALSE, 0);
-	  gtk_container_add(GTK_CONTAINER(vbox), hbox);
-	  gaim_gtk_prefs_labeled_spin_button(hbox, _("Seconds before _resending:"),
-	  "/core/away/auto_response/sec_before_resend",
-	  1, 24 * 60 * 60, sg);
-#endif /* PREFSLASH04 */
 	gaim_gtk_prefs_checkbox(_("_Send auto-response"),
 				  "/core/away/auto_response/enabled", vbox);
 	gaim_gtk_prefs_checkbox(_("_Only send auto-response when idle"),
 				  "/core/away/auto_response/idle_only", vbox);
-#if 0 /* PREFSLASH04 */
-	  gaim_gtk_prefs_checkbox(_("Send auto-response in _active conversations"),
-				  "/core/away/auto_response/in_active_conv", vbox);
-	if (!gaim_prefs_get_bool("/core/away/auto_response/enabled"))
-		gtk_widget_set_sensitive(hbox, FALSE);
-
-	auto_resp_pref_id = gaim_prefs_connect_callback("/core/away/auto_response/enabled",
-												  auto_resp_changed_cb, hbox);
-#endif /* PREFSLASH04 */
 
 	vbox = gaim_gtk_make_frame (ret, _("Idle"));
 	dd = gaim_gtk_prefs_dropdown(vbox, _("Idle _time reporting:"),
--- a/src/prefs.c	Sun May 16 06:12:03 2004 +0000
+++ b/src/prefs.c	Sun May 16 06:39:51 2004 +0000
@@ -115,9 +115,7 @@
 	/* Away -> Auto Response */
 	gaim_prefs_add_none("/core/away/auto_response");
 	gaim_prefs_add_bool("/core/away/auto_response/enabled", TRUE);
-	gaim_prefs_add_bool("/core/away/auto_response/in_active_conv", TRUE);
 	gaim_prefs_add_bool("/core/away/auto_response/idle_only", FALSE);
-	gaim_prefs_add_int("/core/away/auto_response/sec_before_resend", 60);
 
 	/* Buddies */
 	gaim_prefs_add_none("/core/buddies");
@@ -984,6 +982,8 @@
 
 void gaim_prefs_update_old() {
 	/* Remove some no-longer-used prefs */
+	gaim_prefs_remove("/core/away/auto_response/in_active_conv");
+	gaim_prefs_remove("/core/away/auto_response/sec_before_resend");
 	gaim_prefs_remove("/core/conversations/away_back_on_send");
 	gaim_prefs_remove("/core/conversations/send_urls_as_links");
 	gaim_prefs_remove("/core/conversations/im/show_login");
--- a/src/server.c	Sun May 16 06:12:03 2004 +0000
+++ b/src/server.c	Sun May 16 06:39:51 2004 +0000
@@ -40,6 +40,8 @@
 #include "gtkutils.h"
 #include "ui.h"
 
+#define SECS_BEFORE_RESENDING_AUTORESPONSE 600
+
 void serv_login(GaimAccount *account)
 {
 	GaimPlugin *p = gaim_find_prpl(gaim_account_get_protocol_id(account));
@@ -201,9 +203,7 @@
 		tmp = tmp->next;
 		lar = (struct last_auto_response *)cur->data;
 
-		if ((time(NULL) - lar->sent) >
-				gaim_prefs_get_int("/core/away/auto_response/sec_before_resend")) {
-
+		if ((time(NULL) - lar->sent) > SECS_BEFORE_RESENDING_AUTORESPONSE) {
 			last_auto_responses = g_slist_remove(last_auto_responses, lar);
 			g_free(lar);
 		}
@@ -219,8 +219,7 @@
 
 	/* because we're modifying or creating a lar, schedule the
 	 * function to expire them as the pref dictates */
-	gaim_timeout_add((gaim_prefs_get_int("/core/away/auto_response/sec_before_resend") + 1) * 1000,
-			expire_last_auto_responses, NULL);
+	gaim_timeout_add((SECS_BEFORE_RESENDING_AUTORESPONSE + 1) * 1000, expire_last_auto_responses, NULL);
 
 	tmp = last_auto_responses;
 
@@ -279,10 +278,8 @@
 	if (!(imflags & GAIM_CONV_IM_AUTO_RESP))
 		serv_touch_idle(gc);
 
-	if (gc->away &&
-		(gc->flags & GAIM_CONNECTION_AUTO_RESP) &&
-		gaim_prefs_get_bool("/core/away/auto_response/enabled") &&
-		!gaim_prefs_get_bool("/core/away/auto_response/in_active_conv")) {
+	if (gc->away &&	(gc->flags & GAIM_CONNECTION_AUTO_RESP) &&
+		gaim_prefs_get_bool("/core/away/auto_response/enabled")) {
 
 		struct last_auto_response *lar;
 		lar = get_last_auto_response(gc, name);
@@ -1018,9 +1015,7 @@
 		 * if necessary.
 		 */
 		lar = get_last_auto_response(gc, name);
-		if ((t - lar->sent) <
-			gaim_prefs_get_int("/core/away/auto_response/sec_before_resend")) {
-
+		if ((t - lar->sent) < SECS_BEFORE_RESENDING_AUTORESPONSE) {
 			g_free(name);
 			g_free(message);
 			return;