changeset 11837:fa742ad8068c

[gaim-migrate @ 14128] Don't pass our active GaimStatus to the login PRPL callback... It's not used by most PRPLS, and that ones that DO use it probably shouldn't. Ideally the PRPLs won't store any info about their own status, message, etc. All that should be in the core status API, and when it needs some info it should query the core to get it. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 26 Oct 2005 05:40:02 +0000
parents 86cdfd6b32a6
children ded0ec14f5d3
files src/connection.c src/protocols/bonjour/bonjour.c src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/novell/novell.c src/protocols/oscar/oscar.c src/protocols/sametime/sametime.c src/protocols/silc/silc.c src/protocols/simple/simple.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/protocols/zephyr/zephyr.c src/prpl.h
diffstat 16 files changed, 24 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/connection.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/connection.c	Wed Oct 26 05:40:02 2005 +0000
@@ -145,7 +145,7 @@
 		gaim_debug_info("connection", "Connecting. gc = %p\n", gc);
 
 		gaim_signal_emit(gaim_accounts_get_handle(), "account-connecting", account);
-		prpl_info->login(account, gaim_account_get_active_status(account));
+		prpl_info->login(account);
 	}
 }
 
--- a/src/protocols/bonjour/bonjour.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/bonjour/bonjour.c	Wed Oct 26 05:40:02 2005 +0000
@@ -68,11 +68,12 @@
 }
 
 void
-bonjour_login(GaimAccount *account, GaimStatus *status)
+bonjour_login(GaimAccount *account)
 {
 	GaimConnection *gc = gaim_account_get_connection(account);
 	GaimGroup *bonjour_group = NULL;
 	BonjourData *bd = NULL;
+	GaimStatus *status;
 	GaimPresence *presence;
 
 	gc->flags |= GAIM_CONNECTION_HTML;
--- a/src/protocols/gg/gg.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/gg/gg.c	Wed Oct 26 05:40:02 2005 +0000
@@ -1156,7 +1156,7 @@
 /* }}} */
 
 /* static void ggp_login(GaimAccount *account, GaimStatus *status) {{{ */
-static void ggp_login(GaimAccount *account, GaimStatus *status)
+static void ggp_login(GaimAccount *account)
 {
 	GaimConnection *gc = gaim_account_get_connection(account);
 	struct gg_login_params *glp = g_new0(struct gg_login_params, 1);
@@ -1174,6 +1174,7 @@
 	glp->password = (char *)gaim_account_get_password(account);
 
 	glp->async = 0;
+	/* TODO: Set the status correctly here. */
 	glp->status = GG_STATUS_AVAIL;
 	glp->tls = 0;
 
--- a/src/protocols/irc/irc.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/irc/irc.c	Wed Oct 26 05:40:02 2005 +0000
@@ -44,7 +44,7 @@
 static GList *irc_status_types(GaimAccount *account);
 static GList *irc_actions(GaimPlugin *plugin, gpointer context);
 /* static GList *irc_chat_info(GaimConnection *gc); */
-static void irc_login(GaimAccount *account, GaimStatus *status);
+static void irc_login(GaimAccount *account);
 static void irc_login_cb_ssl(gpointer data, GaimSslConnection *gsc, GaimInputCondition cond);
 static void irc_login_cb(gpointer data, gint source, GaimInputCondition cond);
 static void irc_ssl_connect_failure(GaimSslConnection *gsc, GaimSslErrorType error, gpointer data);
@@ -223,7 +223,7 @@
 	return defaults;
 }
 
-static void irc_login(GaimAccount *account, GaimStatus *status)
+static void irc_login(GaimAccount *account)
 {
 	GaimConnection *gc;
 	struct irc_conn *irc;
--- a/src/protocols/jabber/jabber.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/jabber/jabber.c	Wed Oct 26 05:40:02 2005 +0000
@@ -375,7 +375,7 @@
 
 
 static void
-jabber_login(GaimAccount *account, GaimStatus *status)
+jabber_login(GaimAccount *account)
 {
 	GaimConnection *gc = gaim_account_get_connection(account);
 	const char *connect_server = gaim_account_get_string(account,
--- a/src/protocols/msn/msn.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/msn/msn.c	Wed Oct 26 05:40:02 2005 +0000
@@ -699,7 +699,7 @@
 }
 
 static void
-msn_login(GaimAccount *account, GaimStatus *status)
+msn_login(GaimAccount *account)
 {
 	GaimConnection *gc;
 	MsnSession *session;
--- a/src/protocols/napster/napster.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/napster/napster.c	Wed Oct 26 05:40:02 2005 +0000
@@ -518,7 +518,7 @@
 	gc->inpa = gaim_input_add(ndata->fd, GAIM_INPUT_READ, nap_callback, gc);
 }
 
-static void nap_login(GaimAccount *account, GaimStatus *status)
+static void nap_login(GaimAccount *account)
 {
 	GaimConnection *gc = gaim_account_get_connection(account);
 
--- a/src/protocols/novell/novell.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/novell/novell.c	Wed Oct 26 05:40:02 2005 +0000
@@ -2123,7 +2123,7 @@
  ******************************************************************************/
 
 static void
-novell_login(GaimAccount * account, GaimStatus *status)
+novell_login(GaimAccount * account)
 {
 	GaimConnection *gc;
 	NMUser *user = NULL;
--- a/src/protocols/oscar/oscar.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Oct 26 05:40:02 2005 +0000
@@ -1756,22 +1756,14 @@
 }
 
 static void
-oscar_login(GaimAccount *account, GaimStatus *status)
+oscar_login(GaimAccount *account)
 {
 	aim_session_t *sess;
 	aim_conn_t *conn;
 	GaimConnection *gc = gaim_account_get_connection(account);
 	OscarData *od = gc->proto_data = g_new0(OscarData, 1);
-	GaimStatusType *status_type;
-	GaimStatusPrimitive primitive;
-
-	status_type = gaim_status_get_type(status);
-	primitive = gaim_status_type_get_primitive(status_type);
 
 	gaim_debug_misc("oscar", "oscar_login: gc = %p\n", gc);
-	
-	if (primitive == GAIM_STATUS_OFFLINE)
-		return;
 
 	if (!aim_snvalid(gaim_account_get_username(account))) {
 		gchar *buf;
@@ -1791,7 +1783,7 @@
 	sess = g_new0(aim_session_t, 1);
 	aim_session_init(sess, TRUE);
 	/*
-	 * We need an immediate queue because we don't use a while-loop 
+	 * We need an immediate queue because we don't use a while-loop
 	 * to see if things need to be sent.
 	 */
 	aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
--- a/src/protocols/sametime/sametime.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/sametime/sametime.c	Wed Oct 26 05:40:02 2005 +0000
@@ -3028,7 +3028,7 @@
 }
 
 
-static void mw_prpl_login(GaimAccount *acct, GaimStatus *stat);
+static void mw_prpl_login(GaimAccount *acct);
 
 
 static void prompt_host_cancel_cb(GaimConnection *gc) {
@@ -3039,16 +3039,11 @@
 static void prompt_host_ok_cb(GaimConnection *gc, const char *host) {
   if(host && *host) {
     GaimAccount *acct;
-    GaimPresence *pres;
-    GaimStatus *stat;
 
     acct = gaim_connection_get_account(gc);
     gaim_account_set_string(acct, MW_KEY_HOST, host);
 
-    pres = gaim_account_get_presence(acct);
-    stat = gaim_presence_get_active_status(pres);
-
-    mw_prpl_login(acct, stat);
+    mw_prpl_login(acct);
 
   } else {
     prompt_host_cancel_cb(gc);
@@ -3077,7 +3072,7 @@
 }
 
 
-static void mw_prpl_login(GaimAccount *account, GaimStatus *stat) {
+static void mw_prpl_login(GaimAccount *account) {
   GaimConnection *gc;
   struct mwGaimPluginData *pd;
 
--- a/src/protocols/silc/silc.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/silc/silc.c	Wed Oct 26 05:40:02 2005 +0000
@@ -245,7 +245,7 @@
 }
 
 static void
-silcgaim_login(GaimAccount *account, GaimStatus *status)
+silcgaim_login(GaimAccount *account)
 {
 	SilcGaim sg;
 	SilcClient client;
--- a/src/protocols/simple/simple.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/simple/simple.c	Wed Oct 26 05:40:02 2005 +0000
@@ -1244,7 +1244,7 @@
 	}
 }
 
-static void simple_login(GaimAccount *account, GaimStatus *status)
+static void simple_login(GaimAccount *account)
 {
 	GaimConnection *gc;
 	struct simple_account_data *sip;
@@ -1275,6 +1275,7 @@
 
 	gaim_connection_update_progress(gc, _("Connecting"), 1, 2);
 
+	/* TODO: Set the status correctly. */
 	sip->status = g_strdup("available");
 
 	if(!gaim_account_get_bool(account, "useproxy", FALSE)) {
--- a/src/protocols/toc/toc.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/toc/toc.c	Wed Oct 26 05:40:02 2005 +0000
@@ -125,7 +125,7 @@
 /* ok. this function used to take username/password, and return 0 on success.
  * now, it takes username/password, and returns NULL on error or a new gaim_connection
  * on success. */
-static void toc_login(GaimAccount *account, GaimStatus *status)
+static void toc_login(GaimAccount *account)
 {
 	GaimConnection *gc;
 	struct toc_data *tdt;
--- a/src/protocols/yahoo/yahoo.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/yahoo/yahoo.c	Wed Oct 26 05:40:02 2005 +0000
@@ -2444,9 +2444,10 @@
 }
 
 
-static void yahoo_login(GaimAccount *account, GaimStatus *status) {
+static void yahoo_login(GaimAccount *account) {
 	GaimConnection *gc = gaim_account_get_connection(account);
 	struct yahoo_data *yd = gc->proto_data = g_new0(struct yahoo_data, 1);
+	GaimStatus *status = gaim_account_get_active_status(account);
 	const char *id = gaim_status_get_id(status);
 	gc->flags |= GAIM_CONNECTION_HTML | GAIM_CONNECTION_NO_BGCOLOR | GAIM_CONNECTION_NO_URLDESC;
 
--- a/src/protocols/zephyr/zephyr.c	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/protocols/zephyr/zephyr.c	Wed Oct 26 05:40:02 2005 +0000
@@ -1512,7 +1512,7 @@
 	return EXPOSE_REALMVIS;
 }
 
-static void zephyr_login(GaimAccount * account, GaimStatus *status)
+static void zephyr_login(GaimAccount * account)
 {
 	GaimConnection *gc;
 	zephyr_account *zephyr;
--- a/src/prpl.h	Wed Oct 26 05:22:26 2005 +0000
+++ b/src/prpl.h	Wed Oct 26 05:40:02 2005 +0000
@@ -219,7 +219,7 @@
 	/* All the server-related functions */
 
 	/** This must be implemented. */
-	void (*login)(GaimAccount *, GaimStatus *);
+	void (*login)(GaimAccount *);
 
 	/** This must be implemented. */
 	void (*close)(GaimConnection *);