changeset 10404:ce098e226486

[gaim-migrate @ 11649] Make some things better, and some whitespace cleanup. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 24 Dec 2004 00:05:36 +0000
parents e5455f1dc9b6
children 046be0a754b6
files plugins/perl/common/Account.xs plugins/timestamp.c src/account.c src/gtkaccount.c src/gtkconn.c src/gtkmain.c src/gtkstatusselector.c src/protocols/oscar/oscar.c
diffstat 8 files changed, 32 insertions(+), 80 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/perl/common/Account.xs	Thu Dec 23 20:13:54 2004 +0000
+++ b/plugins/perl/common/Account.xs	Fri Dec 24 00:05:36 2004 +0000
@@ -3,10 +3,6 @@
 MODULE = Gaim::Account  PACKAGE = Gaim::Account  PREFIX = gaim_account_
 PROTOTYPES: ENABLE
 
-Gaim::Connection
-gaim_account_connect(account)
-	Gaim::Account account
-
 void
 gaim_account_disconnect(account)
 	Gaim::Account account
@@ -54,12 +50,6 @@
 	Gaim::Account account
 	gboolean value
 
-void
-gaim_account_set_auto_login(account, ui, value)
-	Gaim::Account account
-	const char *ui
-	gboolean value
-
 gboolean
 gaim_account_is_connected(account)
 	Gaim::Account account
@@ -100,11 +90,6 @@
 gaim_account_get_check_mail(account)
 	Gaim::Account account
 
-gboolean
-gaim_account_get_auto_login(account, ui)
-	Gaim::Account account
-	const char *ui
-
 
 MODULE = Gaim::Account  PACKAGE = Gaim::Accounts  PREFIX = gaim_accounts_
 
--- a/plugins/timestamp.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/plugins/timestamp.c	Fri Dec 24 00:05:36 2004 +0000
@@ -20,8 +20,6 @@
  *
  */
 
-
-
 #include "internal.h"
 
 #include "conversation.h"
@@ -41,7 +39,8 @@
 
 static GSList *timestamp_timeouts = NULL;
 
-static gboolean do_timestamp (gpointer data)
+static gboolean
+do_timestamp(gpointer data)
 {
 	GaimConversation *c = (GaimConversation *)data;
 	GaimGtkConversation *conv = GAIM_GTK_CONVERSATION(c);
@@ -49,13 +48,13 @@
 	char mdate[7];
 	int is_conversation_active;
 	time_t tim = time(NULL);
-	
+
 	if (!g_list_find(gaim_get_conversations(), c))
 		return FALSE;
 
 	/* is_conversation_active is true if an im has been displayed since the last timestamp */
 	is_conversation_active = GPOINTER_TO_INT(gaim_conversation_get_data(c, "timestamp-conv-active"));
-	
+
 	if (is_conversation_active){
 		int y, height;
 		GdkRectangle rect;
@@ -73,11 +72,11 @@
 		}
 		gtk_text_buffer_insert_with_tags_by_name(buffer, &iter, mdate, strlen(mdate), "TIMESTAMP", NULL);
 		if (scroll)
-			gtk_imhtml_scroll_to_end(imhtml);
+			gtk_imhtml_scroll_to_end(GTK_IMHTML(imhtml));
 	}
 	else
 		gaim_conversation_set_data(c, "timestamp-enabled", GINT_TO_POINTER(FALSE));
-	
+
 	return TRUE;
 }
 
@@ -87,20 +86,20 @@
 							  char **buffer, void *data)
 {
 	int is_timestamp_enabled;
-	
+
 	if (!g_list_find(gaim_get_conversations(), conv))
 		return FALSE;
-	
+
 	/* set to true, since there has been an im since the last timestamp */
 	gaim_conversation_set_data(conv, "timestamp-conv-active", GINT_TO_POINTER(TRUE));
-	
+
 	is_timestamp_enabled = GPOINTER_TO_INT(gaim_conversation_get_data(conv, "timestamp-enabled"));
-	
+
 	if (!is_timestamp_enabled){
 		gaim_conversation_set_data(conv, "timestamp-enabled", GINT_TO_POINTER(TRUE));
 		do_timestamp((gpointer)conv);
 	}
-	
+
 	return FALSE;
 }
 
@@ -117,10 +116,10 @@
 static void timestamp_new_convo(GaimConversation *conv)
 {
 	GaimGtkConversation *c = GAIM_GTK_CONVERSATION(conv);
-	
+
 	if (!g_list_find(gaim_get_conversations(), conv))
 		return;
-	
+
 	gtk_imhtml_show_comments(GTK_IMHTML(c->imhtml), FALSE);
 
 	/*
@@ -151,7 +150,7 @@
 		g_source_remove(GPOINTER_TO_INT(to->data));
 
 	g_slist_free(timestamp_timeouts);
-	
+
 	timestamp_timeouts = NULL;
 }
 
@@ -159,10 +158,10 @@
 {
 	GList *cnvs;
 	GaimConversation *c;
-	
+
 	if (timestamp_timeouts != NULL)
 		destroy_timer_list();
-	
+
 	for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
 		c = cnvs->data;
 		timestamp_new_convo(c);
@@ -183,7 +182,7 @@
 
 	interval = tm;
 	gaim_prefs_set_int("/plugins/gtk/timestamp/interval", interval);
-	
+
 	destroy_timer_list();
 	init_timer_list();
 }
@@ -233,7 +232,7 @@
 plugin_load(GaimPlugin *plugin)
 {
 	void *conv_handle = gaim_conversations_get_handle();
-	
+
 	init_timer_list();
 
 	gaim_signal_connect(conv_handle, "conversation-created",
@@ -264,7 +263,7 @@
 					plugin, GAIM_CALLBACK(timestamp_receiving_msg));
 	gaim_signal_disconnect(conv_handle, "displaying-im-msg",
 					plugin, GAIM_CALLBACK(timestamp_displaying_conv_msg));
-	
+
 	destroy_timer_list();
 
 	for (cnvs = gaim_get_conversations(); cnvs != NULL; cnvs = cnvs->next) {
@@ -308,7 +307,7 @@
 
 	&ui_info,                                         /**< ui_info        */
 	NULL,                                             /**< extra_info     */
-	NULL,	
+	NULL,
 	NULL
 };
 
--- a/src/account.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/account.c	Fri Dec 24 00:05:36 2004 +0000
@@ -1631,6 +1631,7 @@
 	for (l = gaim_accounts_get_all(); l != NULL; l = l->next) {
 		account = l->data;
 
+		/* TODO: Shouldn't be be using some sort of saved status here? */
 		if (gaim_account_get_enabled(account, ui))
 			gaim_account_connect(account, gaim_account_get_status(account, "online"));
 	}
--- a/src/gtkaccount.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/gtkaccount.c	Fri Dec 24 00:05:36 2004 +0000
@@ -1678,38 +1678,6 @@
  * Accounts Dialog
  **************************************************************************/
 static void
-account_pulse_update(GaimGtkPulseData *pulse_data)
-{
-	GdkPixbuf *pixbuf;
-	GtkTreeIter iter;
-	size_t index = g_list_index(gaim_accounts_get_all(), pulse_data->account);
-
-	if (gtk_tree_model_iter_nth_child(pulse_data->model, &iter, NULL, index))
-	{
-		pixbuf = gdk_pixbuf_copy(pulse_data->online_pixbuf);
-
-		gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf,
-										 pulse_data->pulse_value, FALSE);
-
-		if (pulse_data->pulse_to_grey)
-			pulse_data->pulse_value += 0.20;
-		else
-			pulse_data->pulse_value -= 0.20;
-
-		if (pulse_data->pulse_value >= 1)
-			pulse_data->pulse_to_grey = FALSE;
-		else if (pulse_data->pulse_value <= 0)
-			pulse_data->pulse_to_grey = TRUE;
-
-		gtk_list_store_set(GTK_LIST_STORE(pulse_data->model), &iter,
-						   COLUMN_ICON, pixbuf, -1);
-
-		if (pixbuf != NULL)
-			g_object_unref(G_OBJECT(pixbuf));
-	}
-}
-
-static void
 signed_on_off_cb(GaimConnection *gc, AccountsWindow *dialog)
 {
 	GaimAccount *account = gaim_connection_get_account(gc);
--- a/src/gtkconn.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/gtkconn.c	Fri Dec 24 00:05:36 2004 +0000
@@ -211,7 +211,7 @@
 			l_accts_iter = l_accts;
 			while (l_accts_iter != NULL) {
 				account = l_accts_iter->data;
-				/* gaim_account_connect(account); */
+				gaim_account_connect(account, gaim_account_get_status(account, "online"));
 				l_accts_iter = l_accts_iter->next;
 			}
 			g_list_free(l_accts);
@@ -268,7 +268,7 @@
 			g_list_free(l_del);
 		}
 
-		/* 	gaim_account_connect(account); */
+		gaim_account_connect(account, gaim_account_get_status(account, "online"));
 		disconnect_window_update_buttons(model);
 
 		break;
--- a/src/gtkmain.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/gtkmain.c	Fri Dec 24 00:05:36 2004 +0000
@@ -112,14 +112,14 @@
 			account = gaim_accounts_find(names[i], NULL);
 			if (account != NULL) { /* found a user */
 				ret = 0;
-				//gaim_account_connect(account);
+				gaim_account_connect(account, gaim_account_get_status(account, "online"));
 			}
 		}
 		g_strfreev(names);
 	} else { /* no name given, use the first account */
 		account = (GaimAccount *)gaim_accounts_get_all()->data;
 		ret = 0;
-		//gaim_account_connect(account);
+		gaim_account_connect(account, gaim_account_get_status(account, "online"));
 	}
 
 	return ret;
--- a/src/gtkstatusselector.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/gtkstatusselector.c	Fri Dec 24 00:05:36 2004 +0000
@@ -183,14 +183,13 @@
 
 	g_signal_connect(G_OBJECT(entry), "key_press_event",
 	                 G_CALLBACK(key_press_cb), selector);
-#if 0
 	gaim_signal_connect(gaim_connections_get_handle(), "signed-on",
 	                    selector, GAIM_CALLBACK(signed_on_off_cb),
 	                    selector);
 	gaim_signal_connect(gaim_connections_get_handle(), "signed-off",
 	                    selector, GAIM_CALLBACK(signed_on_off_cb),
 	                    selector);
-#endif 
+
 	rebuild_list(selector);
 }
 
@@ -299,7 +298,7 @@
 		{
 			GaimAccount *account = (GaimAccount*)l->data;
 			GaimStatusType *status_type;
-			
+
 			if (!gaim_account_get_enabled(account, GAIM_GTK_UI))
 				continue;
 
@@ -359,7 +358,7 @@
 		{
 			GaimAccount *account = (GaimAccount*)l->data;
 			GaimStatusType *status_type;
-			
+
 			if (!gaim_account_get_enabled(account, GAIM_GTK_UI))
 				continue;
 
--- a/src/protocols/oscar/oscar.c	Thu Dec 23 20:13:54 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Fri Dec 24 00:05:36 2004 +0000
@@ -6462,10 +6462,10 @@
 static void oscar_chat_invite(GaimConnection *gc, int id, const char *message, const char *name) {
 	OscarData *od = (OscarData *)gc->proto_data;
 	struct chat_connection *ccon = find_oscar_chat(gc, id);
-	
-	if (!ccon)
+
+	if (ccon == NULL)
 		return;
-	
+
 	aim_im_sendch2_chatinvite(od->sess, name, message ? message : "",
 			ccon->exchange, ccon->name, 0x0);
 }
@@ -6491,7 +6491,7 @@
 
 	gaim_debug_info("oscar",
 			   "Attempting to leave room %s (currently in %d rooms)\n", b->name, count);
-	
+
 	c = find_oscar_chat(gc, gaim_conv_chat_get_id(GAIM_CONV_CHAT(b)));
 	if (c != NULL) {
 		if (od)