summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2012-10-22 09:53:28 +0200
committerBerke Viktor <bviktor@hexchat.org>2012-10-22 09:53:28 +0200
commita05817c0ebc1db2512fa42b3949554647d36ab48 (patch)
tree26fe08b4196062b26e1c6869371797b6de3dd219 /src/common
parent0e8ac8b7a1a100a87900ae010edacde50e21af2c (diff)
Variable cleanup for away_*
Diffstat (limited to 'src/common')
-rw-r--r--src/common/cfgfiles.c26
-rw-r--r--src/common/inbound.c4
-rw-r--r--src/common/outbound.c6
-rw-r--r--src/common/text.c12
-rw-r--r--src/common/xchat.c6
-rw-r--r--src/common/xchat.h22
6 files changed, 40 insertions, 36 deletions
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index a83bcd5f..365e6815 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -389,14 +389,14 @@ default_file (void)
 /* Keep these sorted!! */
 
 const struct prefs vars[] = {
-	{"away_auto_unmark", P_OFFINT (auto_unmark_away), TYPE_BOOL},
-	{"away_omit_alerts", P_OFFINT (away_omit_alerts), TYPE_BOOL},
-	{"away_reason", P_OFFSET (awayreason), TYPE_STR},
-	{"away_show_message", P_OFFINT (show_away_message), TYPE_BOOL},
-	{"away_show_once", P_OFFINT (show_away_once), TYPE_BOOL},
-	{"away_size_max", P_OFFINT (away_size_max), TYPE_INT},
-	{"away_timeout", P_OFFINT (away_timeout), TYPE_INT},
-	{"away_track", P_OFFINT (away_track), TYPE_BOOL},
+	{"away_auto_unmark", P_OFFINT (hex_away_auto_unmark), TYPE_BOOL},
+	{"away_omit_alerts", P_OFFINT (hex_away_omit_alerts), TYPE_BOOL},
+	{"away_reason", P_OFFSET (hex_away_reason), TYPE_STR},
+	{"away_show_message", P_OFFINT (hex_away_show_message), TYPE_BOOL},
+	{"away_show_once", P_OFFINT (hex_away_show_once), TYPE_BOOL},
+	{"away_size_max", P_OFFINT (hex_away_size_max), TYPE_INT},
+	{"away_timeout", P_OFFINT (hex_away_timeout), TYPE_INT},
+	{"away_track", P_OFFINT (hex_away_track), TYPE_BOOL},
 
 	{"completion_amount", P_OFFINT (completion_amount), TYPE_INT},
 	{"completion_auto", P_OFFINT (nickcompletion), TYPE_BOOL},
@@ -659,13 +659,13 @@ load_config (void)
 	prefs.show_marker = 1;
 	prefs.newtabstofront = 2;
 	prefs.completion_amount = 5;
-	prefs.away_timeout = 60;
-	prefs.away_size_max = 300;
-	prefs.away_track = 1;
+	prefs.hex_away_timeout = 60;
+	prefs.hex_away_size_max = 300;
+	prefs.hex_away_track = 1;
 	prefs.timestamp_logs = 1;
 	prefs.truncchans = 20;
 	prefs.autoresume = 1;
-	prefs.show_away_once = 1;
+	prefs.hex_away_show_once = 1;
 	prefs.indent_nicks = 1;
 	prefs.thin_separator = 1;
 	prefs.identd = 1;
@@ -776,7 +776,7 @@ load_config (void)
 	snprintf (prefs.dccdir, sizeof (prefs.dccdir), "%s/downloads", get_xdir_utf8 ());
 #endif
 	strcpy (prefs.doubleclickuser, "QUOTE WHOIS %s %s");
-	strcpy (prefs.awayreason, _("I'm busy"));
+	strcpy (prefs.hex_away_reason, _("I'm busy"));
 	strcpy (prefs.quitreason, _("Leaving"));
 	strcpy (prefs.partreason, prefs.quitreason);
 	strcpy (prefs.font_normal, DEF_FONT);
diff --git a/src/common/inbound.c b/src/common/inbound.c
index ce04eaf8..23947dfc 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -433,7 +433,7 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from, char *text
 
 	if (fromme)
 	{
-  		if (prefs.auto_unmark_away && serv->is_away)
+  		if (prefs.hex_away_auto_unmark && serv->is_away)
 			sess->server->p_set_back (sess->server);
 		EMIT_SIGNAL (XP_TE_UCHANMSG, sess, from, text, nickchar, NULL, 0);
 		return;
@@ -942,7 +942,7 @@ inbound_away (server *serv, char *nick, char *msg)
 
 	if (away && !strcmp (msg, away->message))	/* Seen the msg before? */
 	{
-		if (prefs.show_away_once && !serv->inside_whois)
+		if (prefs.hex_away_show_once && !serv->inside_whois)
 			return;
 	} else
 	{
diff --git a/src/common/outbound.c b/src/common/outbound.c
index aca8b3f3..18775b48 100644
--- a/src/common/outbound.c
+++ b/src/common/outbound.c
@@ -378,11 +378,11 @@ cmd_away (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 			reason = sess->server->last_away_reason;
 		else
 			/* must manage memory pointed to by random_line() */
-			reason = random_line (prefs.awayreason);
+			reason = random_line (prefs.hex_away_reason);
 	}
 	sess->server->p_set_away (sess->server, reason);
 
-	if (prefs.show_away_message)
+	if (prefs.hex_away_show_message)
 	{
 		snprintf (tbuf, TBUFSIZE, "me is away: %s", reason);
 		for (list = sess_list; list; list = list->next)
@@ -424,7 +424,7 @@ cmd_back (struct session *sess, char *tbuf, char *word[], char *word_eol[])
 	{
 		sess->server->p_set_back (sess->server);
 
-		if (prefs.show_away_message)
+		if (prefs.hex_away_show_message)
 		{
 			gone = time (NULL) - sess->server->away_time;
 			sprintf (tbuf, "me is back (gone %.2d:%.2d:%.2d)", gone / 3600,
diff --git a/src/common/text.c b/src/common/text.c
index 6736d632..bbd12f05 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -2203,9 +2203,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
 	case XP_TE_DPRIVMSG:
 	case XP_TE_PRIVACTION:
 	case XP_TE_DPRIVACTION:
-		if (chanopt_is_set_a (prefs.input_beep_priv, sess->alert_beep) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_beep_priv, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			sound_beep (sess);
-		if (chanopt_is_set_a (prefs.input_flash_priv, sess->alert_taskbar) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_flash_priv, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			fe_flash_window (sess);
 		/* why is this one different? because of plugin-tray.c's hooks! ugly */
 		if (sess->alert_tray == SET_ON)
@@ -2215,9 +2215,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
 	/* ===Highlighted message=== */
 	case XP_TE_HCHANACTION:
 	case XP_TE_HCHANMSG:
-		if (chanopt_is_set_a (prefs.input_beep_hilight, sess->alert_beep) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			sound_beep (sess);
-		if (chanopt_is_set_a (prefs.input_flash_hilight, sess->alert_taskbar) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			fe_flash_window (sess);
 		if (sess->alert_tray == SET_ON)
 			fe_tray_set_icon (FE_ICON_MESSAGE);
@@ -2226,9 +2226,9 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d)
 	/* ===Channel message=== */
 	case XP_TE_CHANACTION:
 	case XP_TE_CHANMSG:
-		if (chanopt_is_set_a (prefs.input_beep_chans, sess->alert_beep) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_beep_chans, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			sound_beep (sess);
-		if (chanopt_is_set_a (prefs.input_flash_chans, sess->alert_taskbar) && (!prefs.away_omit_alerts || !sess->server->is_away))
+		if (chanopt_is_set_a (prefs.input_flash_chans, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			fe_flash_window (sess);
 		if (sess->alert_tray == SET_ON)
 			fe_tray_set_icon (FE_ICON_MESSAGE);
diff --git a/src/common/xchat.c b/src/common/xchat.c
index 9164be6f..9babd6c4 100644
--- a/src/common/xchat.c
+++ b/src/common/xchat.c
@@ -209,7 +209,7 @@ away_check (void)
 	GSList *list;
 	int full, sent, loop = 0;
 
-	if (!prefs.away_track || prefs.away_size_max < 1)
+	if (!prefs.hex_away_track || prefs.hex_away_size_max < 1)
 		return 1;
 
 doover:
@@ -224,7 +224,7 @@ doover:
 		if (sess->server->connected &&
 			 sess->type == SESS_CHANNEL &&
 			 sess->channel[0] &&
-			 sess->total <= prefs.away_size_max)
+			 sess->total <= prefs.hex_away_size_max)
 		{
 			if (!sess->done_away_check)
 			{
@@ -325,7 +325,7 @@ irc_init (session *sess)
 		notify_tag = fe_timeout_add (prefs.notify_timeout * 1000,
 											  notify_checklist, 0);
 
-	fe_timeout_add (prefs.away_timeout * 1000, away_check, 0);
+	fe_timeout_add (prefs.hex_away_timeout * 1000, away_check, 0);
 	fe_timeout_add (500, xchat_misc_checks, 0);
 
 	if (arg_url != NULL)
diff --git a/src/common/xchat.h b/src/common/xchat.h
index ad95256d..2acf927c 100644
--- a/src/common/xchat.h
+++ b/src/common/xchat.h
@@ -104,13 +104,25 @@ struct nbexec
 
 struct hexchatprefs
 {
+	/* these are the rebranded, consistent, sorted hexchat variables */
+	char hex_away_reason[256];
+
+	int hex_away_size_max;
+	int hex_away_timeout;
+
+	unsigned int hex_away_auto_unmark;
+	unsigned int hex_away_omit_alerts;
+	unsigned int hex_away_show_message;
+	unsigned int hex_away_show_once;
+	unsigned int hex_away_track;
+
+	/* these are the legacy variables */
 	char nick1[NICKLEN];
 	char nick2[NICKLEN];
 	char nick3[NICKLEN];
 	char realname[127];
 	char username[127];
 	char nick_suffix[4];			/* Only ever holds a one-character string. */
-	char awayreason[256];
 	char quitreason[256];
 	char partreason[256];
 	char font_normal[4 * FONTNAMELEN + 1];
@@ -150,9 +162,6 @@ struct hexchatprefs
 	int tint_green;
 	int tint_blue;
 
-	int away_timeout;
-	int away_size_max;
-
 	int gui_pane_left_size;
 	int gui_pane_right_size;
 	int gui_pane_right_size_min;
@@ -264,11 +273,6 @@ struct hexchatprefs
 	unsigned int hidever;
 	unsigned int ip_from_server;
 	unsigned int raw_modes;
-	unsigned int show_away_once;
-	unsigned int show_away_message;
-	unsigned int auto_unmark_away;
-	unsigned int away_track;
-	unsigned int away_omit_alerts;
 	unsigned int userhost;
 	unsigned int irc_whois_front;
 	unsigned int use_server_tab;