diff src/connection.h @ 10740:94cc67130789

[gaim-migrate @ 12342] More big changes, yay. I combined gaim_connection_new and gaim_connection_connect. Earlier today I realized that it's dumb to have a GaimConnection that isn't connected. I'm about to combine gaim_connection_disconnect and gaim_connection_destroy, as well. I added a "password" field to GaimConnection. It holds the password used to login a specific GaimConnection. Now, when "remember password" is false, account->password is NEVER set. When the user tries to sign on and Gaim prompts for the password, it goes directly into the GaimConnection. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 26 Mar 2005 23:25:18 +0000
parents 55af3fa46329
children 4228b6d78506
line wrap: on
line diff
--- a/src/connection.h	Sat Mar 26 21:22:53 2005 +0000
+++ b/src/connection.h	Sat Mar 26 23:25:18 2005 +0000
@@ -79,6 +79,7 @@
 	GaimConnectionState state;   /**< The connection state.              */
 
 	GaimAccount *account;        /**< The account being connected to.    */
+	char *password;              /**< The password used.                 */
 	int inpa;                    /**< The input watcher.                 */
 
 	GSList *buddy_chats;         /**< A list of active chats.            */
@@ -113,44 +114,35 @@
 /*@{*/
 
 /**
- * Creates a connection to the specified account.
+ * This function should only be called by gaim_connection_connect()
+ * in account.c.  If you're trying to sign on an account, use that
+ * function instead.
+ *
+ * Creates a connection to the specified account and either connects
+ * or attempts to register a new account.  If you are logging in,
+ * the connection uses the current active status for this account.
+ * So if you want to sign on as "away," for example, you need to
+ * have called gaim_account_set_status(account, "away").
+ * (And this will call gaim_account_connect() automatically).
  *
  * @param account The account the connection should be connecting to.
- *
- * @return The gaim connection.
+ * @param register Whether we are registering a new account or just
+ *        trying to do a normal signon.
+ * @param password The password to use.
  */
-GaimConnection *gaim_connection_new(GaimAccount *account);
-
-/**
- * Destroys and closes a gaim connection.
- *
- * @param gc The gaim connection to destroy.
- */
-void gaim_connection_destroy(GaimConnection *gc);
+void gaim_connection_new(GaimAccount *account, gboolean regist,
+									const char *password);
 
 /**
  * This function should only be called by gaim_connection_connect()
  * in account.c.  If you're trying to sign on an account, use that
  * function instead.
  *
- * Logs in to this connection.  The connection uses the current
- * active status in the account as the initial status.  So if
- * you want to sign on as "away," for example, you need to
- * have called gaim_account_set_status(account, "away").
- * (And generally this has the effect of also signin on).
- *
- * @param gc The connection to log in.
+ * Disconnects and destroys a GaimConnection.
  *
- * @see gaim_connection_disconnect()
+ * @param gc The gaim connection to destroy.
  */
-void gaim_connection_connect(GaimConnection *gc);
-
-/**
- * Registers a connection.
- *
- * @param gc The connection to register.
- */
-void gaim_connection_register(GaimConnection *gc);
+void gaim_connection_destroy(GaimConnection *gc);
 
 /**
  * This function should only be called by gaim_connection_disconnect()
@@ -216,6 +208,15 @@
 GaimAccount *gaim_connection_get_account(const GaimConnection *gc);
 
 /**
+ * Returns the connection's password.
+ *
+ * @param gc The connection.
+ *
+ * @return The connection's password.
+ */
+const char *gaim_connection_get_password(const GaimConnection *gc);
+
+/**
  * Returns the connection's displayed name.
  *
  * @param gc The connection.