changeset 5565:c3c4aaf69f65

[gaim-migrate @ 5967] More goodies. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 30 May 2003 18:25:11 +0000
parents 187c740f2a4e
children 9896e9068bc4
files src/account.c src/account.h
diffstat 2 files changed, 35 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Fri May 30 18:04:45 2003 +0000
+++ b/src/account.c	Fri May 30 18:25:11 2003 +0000
@@ -324,21 +324,29 @@
 	return account->remember_pass;
 }
 
+gboolean
+gaim_account_get_check_mail(const GaimAccount *account)
+{
+	g_return_val_if_fail(account != NULL, FALSE);
+
+	return account->check_mail;
+}
+
 int
 gaim_account_get_int(const GaimAccount *account, const char *name,
 					 int default_value)
 {
 	GaimAccountSetting *setting;
 
-	g_return_val_if_fail(account != NULL, -1);
-	g_return_val_if_fail(name    != NULL, -1);
+	g_return_val_if_fail(account != NULL, default_value);
+	g_return_val_if_fail(name    != NULL, default_value);
 
 	setting = g_hash_table_lookup(account->settings, name);
 
 	if (setting == NULL)
 		return default_value;
 
-	g_return_val_if_fail(setting->type == GAIM_PREF_INT, -1);
+	g_return_val_if_fail(setting->type == GAIM_PREF_INT, default_value);
 
 	return setting->value.integer;
 }
@@ -349,15 +357,15 @@
 {
 	GaimAccountSetting *setting;
 
-	g_return_val_if_fail(account != NULL, NULL);
-	g_return_val_if_fail(name    != NULL, NULL);
+	g_return_val_if_fail(account != NULL, default_value);
+	g_return_val_if_fail(name    != NULL, default_value);
 
 	setting = g_hash_table_lookup(account->settings, name);
 
 	if (setting == NULL)
 		return default_value;
 
-	g_return_val_if_fail(setting->type == GAIM_PREF_STRING, NULL);
+	g_return_val_if_fail(setting->type == GAIM_PREF_STRING, default_value);
 
 	return setting->value.string;
 }
@@ -368,15 +376,15 @@
 {
 	GaimAccountSetting *setting;
 
-	g_return_val_if_fail(account != NULL, FALSE);
-	g_return_val_if_fail(name    != NULL, FALSE);
+	g_return_val_if_fail(account != NULL, default_value);
+	g_return_val_if_fail(name    != NULL, default_value);
 
 	setting = g_hash_table_lookup(account->settings, name);
 
 	if (setting == NULL)
 		return default_value;
 
-	g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, FALSE);
+	g_return_val_if_fail(setting->type == GAIM_PREF_BOOLEAN, default_value);
 
 	return setting->value.bool;
 }
--- a/src/account.h	Fri May 30 18:04:45 2003 +0000
+++ b/src/account.h	Fri May 30 18:25:11 2003 +0000
@@ -38,6 +38,7 @@
 	char *buddy_icon;           /**< The buddy icon.             */
 
 	gboolean remember_pass;     /**< Remember the password.      */
+	gboolean check_mail;        /**< Check for mail.             */
 
 	GaimProtocol protocol;      /**< The account protocol.       */
 
@@ -150,6 +151,14 @@
 void gaim_account_set_remember_password(GaimAccount *account, gboolean value);
 
 /**
+ * Sets whether or not this account should check for mail.
+ *
+ * @param account The account.
+ * @param value   @c TRUE if it should check for mail.
+ */
+void gaim_account_set_check_mail(GaimAccount *account, gboolean value);
+
+/**
  * Sets a protocol-specific integer setting for an account.
  *
  * @param account The account.
@@ -261,6 +270,15 @@
 gboolean gaim_account_get_remember_password(const GaimAccount *account);
 
 /**
+ * Returns whether or not this account should check for mail.
+ *
+ * @param account The account.
+ *
+ * @return @c TRUE if it should check for mail.
+ */
+gboolean gaim_account_get_check_mail(const GaimAccount *account);
+
+/**
  * Returns a protocol-specific integer setting for an account.
  *
  * @param account       The account.