Only in bitlbee-1.2: bitlbee.pc
Only in bitlbee-1.2: config.h
diff -aur tmp/bitlbee-1.2/irc.c bitlbee-1.2/irc.c
|
old
|
new
|
|
| 1 | | /********************************************************************\ |
| | 1 | /******************************************************************** \ |
| 2 | 2 | * BitlBee -- An IRC to other IM-networks gateway * |
| 3 | 3 | * * |
| 4 | 4 | * Copyright 2002-2004 Wilmer van der Gaast and others * |
| … |
… |
|
| 109 | 109 | set_add( &irc->set, "buddy_sendbuffer", "false", set_eval_bool, irc ); |
| 110 | 110 | set_add( &irc->set, "buddy_sendbuffer_delay", "200", set_eval_int, irc ); |
| 111 | 111 | set_add( &irc->set, "charset", "utf-8", set_eval_charset, irc ); |
| | 112 | set_add( &irc->set, "oscar_recode_charset", "utf-8", set_eval_oscar_recode_charset, irc ); |
| 112 | 113 | set_add( &irc->set, "debug", "false", set_eval_bool, irc ); |
| 113 | 114 | set_add( &irc->set, "default_target", "root", NULL, irc ); |
| 114 | 115 | set_add( &irc->set, "display_namechanges", "false", set_eval_bool, irc ); |
Only in bitlbee-1.2: Makefile.settings
Only in bitlbee-1.2/protocols/oscar: #*merge<2>*#4941WKm#
Only in bitlbee-1.2/protocols/oscar: #*merge*#4941JAg#
diff -aur tmp/bitlbee-1.2/protocols/oscar/oscar.c bitlbee-1.2/protocols/oscar/oscar.c
|
old
|
new
|
|
| 1026 | 1026 | return 1; |
| 1027 | 1027 | } |
| 1028 | 1028 | |
| | 1029 | static char *get_oscar_recode_charset(struct im_connection *ic ) { |
| | 1030 | char *cs; |
| | 1031 | char *src = "ISO8859-1"; |
| | 1032 | if ((cs = set_getstr(&ic->irc->set, "oscar_recode_charset")) && (g_strcasecmp(cs, "utf-8") != 0)) |
| | 1033 | src = cs; |
| | 1034 | return src; |
| | 1035 | } |
| | 1036 | |
| 1029 | 1037 | static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) { |
| 1030 | 1038 | char *tmp = g_malloc(BUF_LONG + 1); |
| 1031 | 1039 | struct im_connection *ic = sess->aux_data; |
| … |
… |
|
| 1040 | 1048 | if (args->icbmflags & AIM_IMFLAGS_UNICODE) |
| 1041 | 1049 | src = "UNICODEBIG"; |
| 1042 | 1050 | else |
| 1043 | | src = "ISO8859-1"; |
| 1044 | | |
| | 1051 | src = get_oscar_recode_charset(ic); |
| | 1052 | |
| 1045 | 1053 | /* Try to use iconv first to convert the message to UTF8 - which is what BitlBee expects */ |
| 1046 | 1054 | if (do_iconv(src, "UTF-8", args->msg, tmp, args->msglen, BUF_LONG) >= 0) { |
| 1047 | 1055 | // Successfully converted! |
| … |
… |
|
| 2237 | 2245 | { |
| 2238 | 2246 | struct im_connection *ic = sess->aux_data; |
| 2239 | 2247 | struct oscar_data *od = ic->proto_data; |
| | 2248 | char tmp[BUF_LONG]; |
| 2240 | 2249 | gchar who[16]; |
| 2241 | 2250 | GString *str; |
| 2242 | 2251 | va_list ap; |
| … |
… |
|
| 2253 | 2262 | str = g_string_sized_new(512); |
| 2254 | 2263 | g_snprintf(who, sizeof(who), "%u", info->uin); |
| 2255 | 2264 | |
| | 2265 | #define translate(x) ((do_iconv(get_oscar_recode_charset(ic), "UTF-8", x, tmp, strlen(x), BUF_LONG) >= 0) ? tmp : x) |
| | 2266 | |
| 2256 | 2267 | g_string_printf(str, "%s: %s - %s: %s", _("UIN"), who, _("Nick"), |
| 2257 | | info->nick ? info->nick : "-"); |
| 2258 | | g_string_append_printf(str, "\n%s: %s", _("First Name"), info->first); |
| 2259 | | g_string_append_printf(str, "\n%s: %s", _("Last Name"), info->last); |
| | 2268 | info->nick ? translate(info->nick) : "-"); |
| | 2269 | g_string_append_printf(str, "\n%s: %s", _("First Name"), translate(info->first)); |
| | 2270 | g_string_append_printf(str, "\n%s: %s", _("Last Name"), translate(info->last)); |
| 2260 | 2271 | g_string_append_printf(str, "\n%s: %s", _("Email Address"), info->email); |
| 2261 | 2272 | if (info->numaddresses && info->email2) { |
| 2262 | 2273 | int i; |
| … |
… |
|
| 2289 | 2300 | g_string_append_printf(str, "\n%s: %s", _("Personal Web Page"), info->personalwebpage); |
| 2290 | 2301 | if (info->info && info->info[0]) { |
| 2291 | 2302 | g_string_sprintfa(str, "\n%s:\n%s\n%s", _("Additional Information"), |
| 2292 | | info->info, _("End of Additional Information")); |
| | 2303 | translate(info->info), _("End of Additional Information")); |
| 2293 | 2304 | } |
| 2294 | 2305 | g_string_append_c(str, '\n'); |
| 2295 | 2306 | if ((info->homeaddr && (info->homeaddr[0])) || (info->homecity && info->homecity[0]) || (info->homestate && info->homestate[0]) || (info->homezip && info->homezip[0])) { |
| 2296 | 2307 | g_string_append_printf(str, "%s:", _("Home Address")); |
| 2297 | | g_string_append_printf(str, "\n%s: %s", _("Address"), info->homeaddr); |
| 2298 | | g_string_append_printf(str, "\n%s: %s", _("City"), info->homecity); |
| 2299 | | g_string_append_printf(str, "\n%s: %s", _("State"), info->homestate); |
| | 2308 | g_string_append_printf(str, "\n%s: %s", _("Address"), translate(info->homeaddr)); |
| | 2309 | g_string_append_printf(str, "\n%s: %s", _("City"), translate(info->homecity)); |
| | 2310 | g_string_append_printf(str, "\n%s: %s", _("State"), translate(info->homestate)); |
| 2300 | 2311 | g_string_append_printf(str, "\n%s: %s", _("Zip Code"), info->homezip); |
| 2301 | 2312 | g_string_append_c(str, '\n'); |
| 2302 | 2313 | } |
| 2303 | 2314 | if ((info->workaddr && info->workaddr[0]) || (info->workcity && info->workcity[0]) || (info->workstate && info->workstate[0]) || (info->workzip && info->workzip[0])) { |
| 2304 | 2315 | g_string_append_printf(str, "%s:", _("Work Address")); |
| 2305 | | g_string_append_printf(str, "\n%s: %s", _("Address"), info->workaddr); |
| 2306 | | g_string_append_printf(str, "\n%s: %s", _("City"), info->workcity); |
| 2307 | | g_string_append_printf(str, "\n%s: %s", _("State"), info->workstate); |
| | 2316 | g_string_append_printf(str, "\n%s: %s", _("Address"), translate(info->workaddr)); |
| | 2317 | g_string_append_printf(str, "\n%s: %s", _("City"), translate(info->workcity)); |
| | 2318 | g_string_append_printf(str, "\n%s: %s", _("State"), translate(info->workstate)); |
| 2308 | 2319 | g_string_append_printf(str, "\n%s: %s", _("Zip Code"), info->workzip); |
| 2309 | 2320 | g_string_append_c(str, '\n'); |
| 2310 | 2321 | } |
| 2311 | 2322 | if ((info->workcompany && info->workcompany[0]) || (info->workdivision && info->workdivision[0]) || (info->workposition && info->workposition[0]) || (info->workwebpage && info->workwebpage[0])) { |
| 2312 | 2323 | g_string_append_printf(str, "%s:", _("Work Information")); |
| 2313 | | g_string_append_printf(str, "\n%s: %s", _("Company"), info->workcompany); |
| 2314 | | g_string_append_printf(str, "\n%s: %s", _("Division"), info->workdivision); |
| 2315 | | g_string_append_printf(str, "\n%s: %s", _("Position"), info->workposition); |
| | 2324 | g_string_append_printf(str, "\n%s: %s", _("Company"), translate(info->workcompany)); |
| | 2325 | g_string_append_printf(str, "\n%s: %s", _("Division"), translate(info->workdivision)); |
| | 2326 | g_string_append_printf(str, "\n%s: %s", _("Position"), translate(info->workposition)); |
| 2316 | 2327 | if (info->workwebpage && info->workwebpage[0]) { |
| 2317 | 2328 | g_string_append_printf(str, "\n%s: %s", _("Web Page"), info->workwebpage); |
| 2318 | 2329 | } |
| 2319 | 2330 | g_string_append_c(str, '\n'); |
| 2320 | 2331 | } |
| 2321 | 2332 | |
| | 2333 | #undef translate |
| | 2334 | |
| 2322 | 2335 | imcb_log(ic, "%s\n%s", _("User Info"), str->str); |
| 2323 | 2336 | g_string_free(str, TRUE); |
| 2324 | 2337 | |
diff -aur tmp/bitlbee-1.2/set.c bitlbee-1.2/set.c
|
old
|
new
|
|
| 244 | 244 | g_iconv_close( cd ); |
| 245 | 245 | return value; |
| 246 | 246 | } |
| | 247 | |
| | 248 | char *set_eval_oscar_recode_charset( set_t *set, char *value ) |
| | 249 | { |
| | 250 | GIConv cd; |
| | 251 | |
| | 252 | if ( g_strncasecmp( value, "none", 4 ) == 0 ) |
| | 253 | return value; |
| | 254 | |
| | 255 | cd = g_iconv_open( "UTF-8", value ); |
| | 256 | if( cd == (GIConv) -1 ) |
| | 257 | return NULL; |
| | 258 | |
| | 259 | g_iconv_close( cd ); |
| | 260 | return value; |
| | 261 | } |
diff -aur tmp/bitlbee-1.2/set.h bitlbee-1.2/set.h
|
old
|
new
|
|
| 97 | 97 | char *set_eval_to_char( set_t *set, char *value ); |
| 98 | 98 | char *set_eval_ops( set_t *set, char *value ); |
| 99 | 99 | char *set_eval_charset( set_t *set, char *value ); |
| | 100 | char *set_eval_oscar_recode_charset( set_t *set, char *value ); |
| 100 | 101 | |
| 101 | 102 | #endif /* __SET_H__ */ |