comparison src/protocols/oscar/im.c @ 9806:41b97d72e647

[gaim-migrate @ 10674] Clean up oscar incoming IM parsing/charset converting. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 21 Aug 2004 21:53:57 +0000
parents a4fd6666bb83
children 0c170246a9ec
comparison
equal deleted inserted replaced
9805:ccf5a52730b9 9806:41b97d72e647
1314 * suspicious. 1314 * suspicious.
1315 * 1315 *
1316 */ 1316 */
1317 static int incomingim_ch1_parsemsgs(aim_session_t *sess, fu8_t *data, int len, struct aim_incomingim_ch1_args *args) 1317 static int incomingim_ch1_parsemsgs(aim_session_t *sess, fu8_t *data, int len, struct aim_incomingim_ch1_args *args)
1318 { 1318 {
1319 /* Should this be ASCII -> UNICODE -> Custom */
1319 static const fu16_t charsetpri[] = { 1320 static const fu16_t charsetpri[] = {
1320 0x0000, /* ASCII first */ 1321 AIM_IMCHARSET_ASCII, /* ASCII first */
1321 0x0003, /* then ISO-8859-1 */ 1322 AIM_IMCHARSET_CUSTOM, /* then ISO-8859-1 */
1322 0x0002, /* UNICODE as last resort */ 1323 AIM_IMCHARSET_UNICODE, /* UNICODE as last resort */
1323 }; 1324 };
1324 static const int charsetpricount = 3; 1325 static const int charsetpricount = 3;
1325 int i; 1326 int i;
1326 aim_bstream_t mbs; 1327 aim_bstream_t mbs;
1327 aim_mpmsg_section_t *sec; 1328 aim_mpmsg_section_t *sec;
1386 /* Great. We found one. Fill it in. */ 1387 /* Great. We found one. Fill it in. */
1387 args->charset = sec->charset; 1388 args->charset = sec->charset;
1388 args->charsubset = sec->charsubset; 1389 args->charsubset = sec->charsubset;
1389 1390
1390 /* Set up the simple flags */ 1391 /* Set up the simple flags */
1391 if (args->charset == 0x0000) 1392 if (args->charset == AIM_IMCHARSET_ASCII)
1392 ; /* ASCII */ 1393 ; /* ASCII */
1393 else if (args->charset == 0x0002) 1394 else if (args->charset == AIM_IMCHARSET_UNICODE)
1394 args->icbmflags |= AIM_IMFLAGS_UNICODE; 1395 args->icbmflags |= AIM_IMFLAGS_UNICODE;
1395 else if (args->charset == 0x0003) 1396 else if (args->charset == AIM_IMCHARSET_CUSTOM)
1396 args->icbmflags |= AIM_IMFLAGS_ISO_8859_1; 1397 args->icbmflags |= AIM_IMFLAGS_ISO_8859_1;
1397 else if (args->charset == 0xffff) 1398 else if (args->charset == 0xffff)
1398 ; /* no encoding (yeep!) */ 1399 ; /* no encoding (yeep!) */
1399 1400
1400 if (args->charsubset == 0x0000) 1401 if (args->charsubset == 0x0000)