diff src/accountopt.c @ 10658:61930cadca7c

[gaim-migrate @ 12190] sf patch #1108846, from Richard Laager This patch allows one to create protocol plugin options which are masked. This is useful for storing passwords, etc. This patch implements functions similar to the masking functions for general plugin preferences. I'm submitting this for inclusion in Gaim because I've written a plugin which hides the NickServ or Q (for QuakeNet) authentication details from the user. It makes IRC feel more like the other protocols in Gaim. I'd like to have the passwords masked in the preferences to match other password fields in Gaim. This is the only change to Gaim I need for my plugin to work. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 06 Mar 2005 06:14:26 +0000
parents 1a62ab7225f3
children d5937f126c60
line wrap: on
line diff
--- a/src/accountopt.c	Sun Mar 06 02:23:03 2005 +0000
+++ b/src/accountopt.c	Sun Mar 06 06:14:26 2005 +0000
@@ -169,6 +169,16 @@
 }
 
 void
+gaim_account_option_set_masked(GaimAccountOption *option, gboolean masked)
+{
+	g_return_if_fail(option != NULL);
+	g_return_if_fail(option->type == GAIM_PREF_STRING);
+
+	option->masked = masked;
+}
+
+
+void
 gaim_account_option_set_list(GaimAccountOption *option, GList *values)
 {
 	g_return_if_fail(option != NULL);
@@ -249,6 +259,15 @@
 	return option->default_value.string;
 }
 
+gboolean
+gaim_account_option_get_masked(const GaimAccountOption *option)
+{
+	g_return_val_if_fail(option != NULL, FALSE);
+	g_return_val_if_fail(option->type == GAIM_PREF_STRING, FALSE);
+
+	return option->masked;
+}
+
 const GList *
 gaim_account_option_get_list(const GaimAccountOption *option)
 {