From: <dat...@us...> - 2006-11-29 05:27:49
|
Revision: 17844 http://svn.sourceforge.net/gaim/?rev=17844&view=rev Author: datallah Date: 2006-11-28 21:27:49 -0800 (Tue, 28 Nov 2006) Log Message: ----------- On win32, use the current locale charset as the default fallback for oscar. Sean suggested this, it is based on the idea that you're likely to be talking people using a similar locale to you - so if they are using an ICQ client that just sends it in the current locale encoding, it will just work. For the en_US locale, this becomes the "CP1252" encoding. I also removed some duplicate definitions. Modified Paths: -------------- trunk/libgaim/protocols/oscar/oscar.c trunk/libgaim/protocols/oscar/oscarcommon.h Modified: trunk/libgaim/protocols/oscar/oscar.c =================================================================== --- trunk/libgaim/protocols/oscar/oscar.c 2006-11-29 01:20:34 UTC (rev 17843) +++ trunk/libgaim/protocols/oscar/oscar.c 2006-11-29 05:27:49 UTC (rev 17844) @@ -62,13 +62,6 @@ #define AIMHASHDATA "http://gaim.sourceforge.net/aim_data.php3" #define OSCAR_CONNECT_STEPS 6 -#define OSCAR_DEFAULT_LOGIN_SERVER "login.oscar.aol.com" -#define OSCAR_DEFAULT_LOGIN_PORT 5190 -#define OSCAR_DEFAULT_CUSTOM_ENCODING "ISO-8859-1" -#define OSCAR_DEFAULT_AUTHORIZATION TRUE -#define OSCAR_DEFAULT_HIDE_IP TRUE -#define OSCAR_DEFAULT_WEB_AWARE FALSE -#define OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY FALSE static OscarCapability gaim_caps = OSCAR_CAPABILITY_CHAT | OSCAR_CAPABILITY_BUDDYICON | OSCAR_CAPABILITY_DIRECTIM | OSCAR_CAPABILITY_SENDFILE | OSCAR_CAPABILITY_UNICODE | OSCAR_CAPABILITY_INTEROPERATE | OSCAR_CAPABILITY_ICHAT; @@ -215,6 +208,15 @@ g_free(data); } +#ifdef _WIN32 +const char *oscar_get_locale_charset(void) { + static const char *charset = NULL; + if (charset == NULL) + g_get_charset(&charset); + return charset; +} +#endif + /** * Determine how we can send this message. Per the warnings elsewhere * in this file, these little checks determine the simplest encoding @@ -2316,12 +2318,10 @@ if (i >= 6) { struct name_data *data = g_new(struct name_data, 1); gchar *sn = g_strdup_printf("%u", args->uin); - gchar *reason; + gchar *reason = NULL; if (msg2[5] != NULL) reason = gaim_plugin_oscar_decode_im_part(account, sn, AIM_CHARSET_CUSTOM, 0x0000, msg2[5], strlen(msg2[5])); - else - reason = NULL; gaim_debug_info("oscar", "Received an authorization request from UIN %u\n", @@ -2329,7 +2329,7 @@ data->gc = gc; data->name = sn; data->nick = NULL; - + gaim_account_request_authorization(gaim_connection_get_account(gc), sn, NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(reason); @@ -3503,9 +3503,9 @@ aim_clientready(od, conn); - if (gaim_account_get_user_info(account) != NULL) - serv_set_info(gc, gaim_account_get_user_info(account)); - + if (gaim_account_get_user_info(account) != NULL) + serv_set_info(gc, gaim_account_get_user_info(account)); + /* Set our available message based on the current status */ status = gaim_account_get_active_status(account); if (gaim_status_is_available(status)) @@ -5031,7 +5031,7 @@ data->name = g_strdup(sn); data->nick = NULL; - gaim_account_request_authorization(gaim_connection_get_account(gc), nombre, NULL, NULL, reason, + gaim_account_request_authorization(gaim_connection_get_account(gc), nombre, NULL, NULL, reason, G_CALLBACK(gaim_auth_grant), G_CALLBACK(gaim_auth_dontgrant_msgprompt), data); g_free(nombre); g_free(reason); Modified: trunk/libgaim/protocols/oscar/oscarcommon.h =================================================================== --- trunk/libgaim/protocols/oscar/oscarcommon.h 2006-11-29 01:20:34 UTC (rev 17843) +++ trunk/libgaim/protocols/oscar/oscarcommon.h 2006-11-29 05:27:49 UTC (rev 17844) @@ -31,12 +31,19 @@ #define OSCAR_DEFAULT_LOGIN_SERVER "login.oscar.aol.com" #define OSCAR_DEFAULT_LOGIN_PORT 5190 +#ifndef _WIN32 #define OSCAR_DEFAULT_CUSTOM_ENCODING "ISO-8859-1" +#else +#define OSCAR_DEFAULT_CUSTOM_ENCODING oscar_get_locale_charset() +#endif #define OSCAR_DEFAULT_AUTHORIZATION TRUE #define OSCAR_DEFAULT_HIDE_IP TRUE #define OSCAR_DEFAULT_WEB_AWARE FALSE #define OSCAR_DEFAULT_ALWAYS_USE_RV_PROXY FALSE +#ifdef _WIN32 +const char *oscar_get_locale_charset(void); +#endif const char *oscar_list_icon_icq(GaimAccount *a, GaimBuddy *b); const char *oscar_list_icon_aim(GaimAccount *a, GaimBuddy *b); void oscar_list_emblems(GaimBuddy *b, const char **se, const char **sw, const char **nw, const char **ne); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |