From: <sea...@us...> - 2006-11-17 19:39:17
|
Revision: 17769 http://svn.sourceforge.net/gaim/?rev=17769&view=rev Author: seanegan Date: 2006-11-17 11:39:17 -0800 (Fri, 17 Nov 2006) Log Message: ----------- Change oscar-to-aim-and-icq hack. This does the renaming gtkgaim, after everything's initialized (so it fixes broken Persons and pounces and savedstatuses, but it introduces a hack in gaim_account_get_protocol_id(), since some initialization requires the protocol id to match the plugin. I don't really like this, but it's the best workaround I could think of. Hopefully we can remove this after not-long. Modified Paths: -------------- trunk/gtk/gtkmain.c trunk/libgaim/account.c Modified: trunk/gtk/gtkmain.c =================================================================== --- trunk/gtk/gtkmain.c 2006-11-17 19:27:58 UTC (rev 17768) +++ trunk/gtk/gtkmain.c 2006-11-17 19:39:17 UTC (rev 17769) @@ -726,6 +726,22 @@ /* TODO: Move pounces loading into gaim_pounces_init() */ gaim_pounces_load(); + + /* HACK BY SEANEGAN: + * We've renamed prpl-oscar to prpl-aim and prpl-icq, accordingly. + * Let's do that change right here... after everything's loaded, but + * before anything has happened + */ + for (accounts = gaim_accounts_get_all(); accounts != NULL; accounts = accounts->next) { + GaimAccount *account = accounts->data; + if (!strcmp(gaim_account_get_protocol_id(account), "prpl-oscar")) { + if (isdigit(gaim_account_get_username(account))) + gaim_account_set_protocol_id(account, "prpl-icq"); + else + gaim_account_set_protocol_id(account, "prpl-aim"); + } + } + ui_main(); #ifdef USE_SM Modified: trunk/libgaim/account.c =================================================================== --- trunk/libgaim/account.c 2006-11-17 19:27:58 UTC (rev 17768) +++ trunk/libgaim/account.c 2006-11-17 19:39:17 UTC (rev 17769) @@ -697,19 +697,6 @@ return NULL; } - - /* HACK BY SEANEGAN: special case prpl-oscar to either prpl-icq - * prpl-aim for users upgrading to 2.0.0. This can probably - * be removed after a while - */ - if (!strcmp(protocol_id, "prpl-oscar")) { - g_free(protocol_id); - if (isdigit(name[0])) - protocol_id = g_strdup("prpl-icq"); - else - protocol_id = g_strdup("prpl-aim"); - } - ret = gaim_account_new(name, protocol_id); g_free(name); g_free(protocol_id); @@ -1663,7 +1650,15 @@ gaim_account_get_protocol_id(const GaimAccount *account) { g_return_val_if_fail(account != NULL, NULL); - + /* + * HACK by Seanegan + */ + if (!strcmp(account->protocol_id, "prpl-oscar")) { + if (isdigit(account->username[0])) + return "prpl-icq"; + else + return "prpl-aim"; + } return account->protocol_id; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |