comparison 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
comparison
equal deleted inserted replaced
10739:42dbc4ba1325 10740:94cc67130789
77 GaimConnectionFlags flags; /**< Connection flags. */ 77 GaimConnectionFlags flags; /**< Connection flags. */
78 78
79 GaimConnectionState state; /**< The connection state. */ 79 GaimConnectionState state; /**< The connection state. */
80 80
81 GaimAccount *account; /**< The account being connected to. */ 81 GaimAccount *account; /**< The account being connected to. */
82 char *password; /**< The password used. */
82 int inpa; /**< The input watcher. */ 83 int inpa; /**< The input watcher. */
83 84
84 GSList *buddy_chats; /**< A list of active chats. */ 85 GSList *buddy_chats; /**< A list of active chats. */
85 void *proto_data; /**< Protocol-specific data. */ 86 void *proto_data; /**< Protocol-specific data. */
86 87
111 /** @name Connection API */ 112 /** @name Connection API */
112 /**************************************************************************/ 113 /**************************************************************************/
113 /*@{*/ 114 /*@{*/
114 115
115 /** 116 /**
116 * Creates a connection to the specified account.
117 *
118 * @param account The account the connection should be connecting to.
119 *
120 * @return The gaim connection.
121 */
122 GaimConnection *gaim_connection_new(GaimAccount *account);
123
124 /**
125 * Destroys and closes a gaim connection.
126 *
127 * @param gc The gaim connection to destroy.
128 */
129 void gaim_connection_destroy(GaimConnection *gc);
130
131 /**
132 * This function should only be called by gaim_connection_connect() 117 * This function should only be called by gaim_connection_connect()
133 * in account.c. If you're trying to sign on an account, use that 118 * in account.c. If you're trying to sign on an account, use that
134 * function instead. 119 * function instead.
135 * 120 *
136 * Logs in to this connection. The connection uses the current 121 * Creates a connection to the specified account and either connects
137 * active status in the account as the initial status. So if 122 * or attempts to register a new account. If you are logging in,
138 * you want to sign on as "away," for example, you need to 123 * the connection uses the current active status for this account.
124 * So if you want to sign on as "away," for example, you need to
139 * have called gaim_account_set_status(account, "away"). 125 * have called gaim_account_set_status(account, "away").
140 * (And generally this has the effect of also signin on). 126 * (And this will call gaim_account_connect() automatically).
141 * 127 *
142 * @param gc The connection to log in. 128 * @param account The account the connection should be connecting to.
143 * 129 * @param register Whether we are registering a new account or just
144 * @see gaim_connection_disconnect() 130 * trying to do a normal signon.
145 */ 131 * @param password The password to use.
146 void gaim_connection_connect(GaimConnection *gc); 132 */
147 133 void gaim_connection_new(GaimAccount *account, gboolean regist,
148 /** 134 const char *password);
149 * Registers a connection. 135
150 * 136 /**
151 * @param gc The connection to register. 137 * This function should only be called by gaim_connection_connect()
152 */ 138 * in account.c. If you're trying to sign on an account, use that
153 void gaim_connection_register(GaimConnection *gc); 139 * function instead.
140 *
141 * Disconnects and destroys a GaimConnection.
142 *
143 * @param gc The gaim connection to destroy.
144 */
145 void gaim_connection_destroy(GaimConnection *gc);
154 146
155 /** 147 /**
156 * This function should only be called by gaim_connection_disconnect() 148 * This function should only be called by gaim_connection_disconnect()
157 * in account.c. If you're trying to sign out an account, use that 149 * in account.c. If you're trying to sign out an account, use that
158 * function instead. 150 * function instead.
212 * @param gc The connection. 204 * @param gc The connection.
213 * 205 *
214 * @return The connection's account. 206 * @return The connection's account.
215 */ 207 */
216 GaimAccount *gaim_connection_get_account(const GaimConnection *gc); 208 GaimAccount *gaim_connection_get_account(const GaimConnection *gc);
209
210 /**
211 * Returns the connection's password.
212 *
213 * @param gc The connection.
214 *
215 * @return The connection's password.
216 */
217 const char *gaim_connection_get_password(const GaimConnection *gc);
217 218
218 /** 219 /**
219 * Returns the connection's displayed name. 220 * Returns the connection's displayed name.
220 * 221 *
221 * @param gc The connection. 222 * @param gc The connection.