changeset 9971:ab5db2c5da79

[gaim-migrate @ 10882] Remove the default prpl, patch from datallah Patch from nosnilmot that might make recent buddies work Someone check my get_proto_smileys function. I feel like it could be better committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 08 Sep 2004 02:33:53 +0000
parents 837dc736e84f
children 2c7c6bdb938b
files plugins/autorecon.c src/account.c src/gtkaccount.c src/gtkimhtmltoolbar.c src/main.c src/protocols/oscar/oscar.c src/prpl.h src/themes.c
diffstat 8 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/autorecon.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/plugins/autorecon.c	Wed Sep 08 02:33:53 2004 +0000
@@ -227,7 +227,7 @@
 	gaim_prefs_add_none(AUTORECON_OPT);
 	gaim_prefs_add_bool(OPT_HIDE_CONNECTED, FALSE);
 	gaim_prefs_add_bool(OPT_HIDE_CONNECTING, FALSE);
-	gaim_prefs_remove_bool(OPT_RESTORE_STATE);
+	gaim_prefs_remove(OPT_RESTORE_STATE);
 }
 
 GAIM_INIT_PLUGIN(autorecon, init_plugin, info)
--- a/src/account.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/account.c	Wed Sep 08 02:33:53 2004 +0000
@@ -128,9 +128,9 @@
 	GaimAccount *account = NULL;
 
 	g_return_val_if_fail(username != NULL, NULL);
+	g_return_val_if_fail(protocol_id != NULL, NULL);
 
-	if (protocol_id != NULL)
-		account = gaim_accounts_find(username, protocol_id);
+	account = gaim_accounts_find(username, protocol_id);
 
 	if (account != NULL)
 		return account;
@@ -139,8 +139,7 @@
 
 	gaim_account_set_username(account, username);
 
-	gaim_account_set_protocol_id(account,
-		(protocol_id ? protocol_id : GAIM_PROTO_DEFAULT));
+	gaim_account_set_protocol_id(account, protocol_id);
 
 	account->settings = g_hash_table_new_full(g_str_hash, g_str_equal,
 											  g_free, delete_setting);
--- a/src/gtkaccount.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/gtkaccount.c	Wed Sep 08 02:33:53 2004 +0000
@@ -1566,8 +1566,12 @@
 	dialog->type    = type;
 	dialog->sg      = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 
-	if (dialog->account == NULL)
-		dialog->protocol_id = g_strdup(GAIM_PROTO_DEFAULT);
+	if (dialog->account == NULL) {
+		/* Select the first prpl in the list*/
+		GList *prpl_list = gaim_plugins_get_protocols();
+		if (prpl_list != NULL)
+			dialog->protocol_id = ((GaimPlugin *) prpl_list->data)->info->id;
+	}
 	else
 	{
 		dialog->protocol_id =
--- a/src/gtkimhtmltoolbar.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/gtkimhtmltoolbar.c	Wed Sep 08 02:33:53 2004 +0000
@@ -621,7 +621,7 @@
 		if (toolbar->sml)
 			smileys = get_proto_smileys(toolbar->sml);
 		else
-			smileys = get_proto_smileys(GAIM_PROTO_DEFAULT);
+			smileys = get_proto_smileys(NULL);
 
 		while(smileys) {
 			GtkIMHtmlSmiley *smiley = smileys->data;
--- a/src/main.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/main.c	Wed Sep 08 02:33:53 2004 +0000
@@ -425,19 +425,15 @@
 	return 0;
 }
 
-static void set_first_user(char *name)
+static void set_first_user(const char *name)
 {
 	GaimAccount *account;
 
 	account = gaim_accounts_find(name, NULL);
 
-	if (account == NULL) { /* new user */
-		account = gaim_account_new(name, GAIM_PROTO_DEFAULT);
-		gaim_accounts_add(account);
-	}
-
 	/* Place it as the first user. */
-	gaim_accounts_reorder(account, 0);
+	if (account != NULL)
+		gaim_accounts_reorder(account, 0);
 }
 
 static void
--- a/src/protocols/oscar/oscar.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Wed Sep 08 02:33:53 2004 +0000
@@ -91,7 +91,7 @@
 	gboolean chpass;
 	char *oldp;
 	char *newp;
-	
+
 	GSList *oscar_chats;
 	GSList *direct_ims;
 	GSList *file_transfers;
@@ -103,6 +103,7 @@
 	guint icontimer;
 	guint getblisttimer;
 	guint getinfotimer;
+	guint recentbuddies_cbid;
 
 	struct {
 		guint maxwatchers; /* max users who can watch you */
@@ -1721,7 +1722,7 @@
 	sess->aux_data = gc;
 
 	/* Connect to core Gaim signals */
-	gaim_prefs_connect_callback("/plugins/prpl/oscar/recent_buddies", recent_buddies_cb, gc);
+	od->recentbuddies_cbid = gaim_prefs_connect_callback("/plugins/prpl/oscar/recent_buddies", recent_buddies_cb, gc);
 
 	conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
 	if (conn == NULL) {
@@ -1803,6 +1804,8 @@
 		gaim_timeout_remove(od->getblisttimer);
 	if (od->getinfotimer > 0)
 		gaim_timeout_remove(od->getinfotimer);
+	gaim_prefs_disconnect_callback(od->recentbuddies->cbid);
+
 	aim_session_kill(od->sess);
 	g_free(od->sess);
 	od->sess = NULL;
@@ -7310,10 +7313,12 @@
 	presence = aim_ssi_getpresence(sess->ssi.local);
 
 	if (value) {
-		presence |= 0x00400000;
+//		presence |= 0x00400000;
+		presence &= ~0x00020000;
 		aim_ssi_setpresence(sess, presence);
 	} else {
-		presence &= ~0x00400000;
+//		presence &= ~0x00400000;
+		presence |= 0x00020000;
 		aim_ssi_setpresence(sess, presence);
 	}
 }
--- a/src/prpl.h	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/prpl.h	Wed Sep 08 02:33:53 2004 +0000
@@ -45,9 +45,6 @@
 		"the \"Accounts\" button on the login window or "   \
 		"in the \"Tools\" menu in the buddy list window."
 
-/** Default protocol */
-#define GAIM_PROTO_DEFAULT "prpl-oscar"
-
 /*@}*/
 
 /**
--- a/src/themes.c	Wed Sep 08 02:15:18 2004 +0000
+++ b/src/themes.c	Wed Sep 08 02:33:53 2004 +0000
@@ -239,21 +239,23 @@
 }
 
 GSList *get_proto_smileys(const char *id) {
-	GaimPlugin *proto = gaim_find_prpl(id);
+	GaimPlugin *proto;
 	struct smiley_list *list, *def;
 
-	if(!current_smiley_theme)
-		return NULL;
-
-	if(!current_smiley_theme->list)
+	if ((current_smiley_theme == NULL) || (current_smiley_theme->list == NULL))
 		return NULL;
 
 	def = list = current_smiley_theme->list;
 
-	while(list) {
-		if(!strcmp(list->sml, "default"))
+	if (id == NULL)
+		return def->smileys;
+
+	proto = gaim_find_prpl(id);
+
+	while (list) {
+		if (!strcmp(list->sml, "default"))
 			def = list;
-		else if(proto && !strcmp(proto->info->name, list->sml))
+		else if (proto && !strcmp(proto->info->name, list->sml))
 			break;
 
 		list = list->next;