Группа :: Сети/Чат
Пакет: gaim
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: gaim-0.78-oscar.patch
*** gaim-0.78/src/protocols/oscar/oscar.c~ 2004-05-30 21:04:55.000000000 +0400
--- gaim-0.78/src/protocols/oscar/oscar.c 2004-06-05 22:14:22.000000000 +0400
***************
*** 3019,3024 ****
--- 3019,3025 ----
GError *err = NULL;
struct buddyinfo *bi;
const char *iconfile;
+ char *charset;
bi = g_hash_table_lookup(od->buddyinfo, gaim_normalize(account, userinfo->sn));
if (!bi) {
***************
*** 3103,3108 ****
--- 3104,3110 ----
* gaim (everything before 0.60) and other broken clients
* that will happily send ISO-8859-1 without marking it as
* such */
+
if (args->icbmflags & AIM_IMFLAGS_ISO_8859_1)
gaim_debug_info("oscar",
"Received ISO-8859-1 IM\n");
***************
*** 3110,3119 ****
if (!args->msg || !args->msglen)
return 1;
! tmp = g_convert(args->msg, args->msglen, "UTF-8", "ISO-8859-1", NULL, &convlen, &err);
if (err) {
! gaim_debug_info("oscar",
! "ISO-8859-1 IM conversion: %s\n", err->message);
tmp = g_strdup(_("(There was an error receiving this message)"));
g_error_free(err);
}
--- 3112,3122 ----
if (!args->msg || !args->msglen)
return 1;
! charset = gaim_account_get_string(account, "plain_charset", "ISO-8859-1");
! tmp = g_convert(args->msg, args->msglen, "UTF-8", charset, NULL, &convlen, &err);
if (err) {
! gaim_debug(GAIM_DEBUG_INFO, "oscar",
! "%s IM conversion: %s\n", charset, err->message);
tmp = g_strdup(_("(There was an error receiving this message)"));
g_error_free(err);
}
***************
*** 5133,5138 ****
--- 5136,5143 ----
GError *err = NULL;
const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc));
char *tmpmsg = NULL, *tmpmsg2 = NULL;
+ GaimAccount *account = gc->account;
+ char *charset;
if (dim && dim->connected) {
/* If we're directly connected, send a direct IM */
***************
*** 5233,5239 ****
}
len = strlen(tmpmsg);
! args.flags |= oscar_encoding_check(tmpmsg);
if (args.flags & AIM_IMFLAGS_UNICODE) {
gaim_debug_info("oscar", "Sending Unicode IM\n");
args.charset = 0x0002;
--- 5238,5245 ----
}
len = strlen(tmpmsg);
! if(!(gaim_account_get_bool(account, "send_plain", FALSE)))
! args.flags |= oscar_encoding_check(tmpmsg);
if (args.flags & AIM_IMFLAGS_UNICODE) {
gaim_debug_info("oscar", "Sending Unicode IM\n");
args.charset = 0x0002;
***************
*** 5272,5278 ****
} else {
args.charset = 0x0000;
args.charsubset = 0x0000;
! args.msg = tmpmsg;
}
args.msglen = len;
--- 5278,5287 ----
} else {
args.charset = 0x0000;
args.charsubset = 0x0000;
! charset = gaim_account_get_string(account, "plain_charset", "ISO-8859-1");
! args.msg = g_convert(tmpmsg, len, charset, "UTF-8", NULL, &len, &err);
! if (err) gaim_debug(GAIM_DEBUG_ERROR, "oscar",
! "conversion error: %s\n", err->message);
}
args.msglen = len;
***************
*** 7230,7235 ****
--- 7239,7255 ----
option = gaim_account_option_int_new(_("Auth port"), "port", 5190);
prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
option);
+ option = gaim_account_option_string_new(
+ _("Charset for plain text messages"),
+ "plain_charset", "ISO-8859-1");
+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+ option);
+
+ option = gaim_account_option_bool_new(
+ _("Send messages in plain text"),
+ "send_plain", FALSE);
+ prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+ option);
my_protocol = plugin;
}