src/protocols/oscar/oscar.c

changeset 4665
d417f1b1a61b
parent 4664
1f5d72a07e64
child 4666
fd74a2faaf94
equal deleted inserted replaced
4664:1f5d72a07e64 4665:d417f1b1a61b
97 * Winicq doesn't mind. */ 97 * Winicq doesn't mind. */
98 static int caps_icq = AIM_CAPS_BUDDYICON | AIM_CAPS_IMIMAGE | AIM_CAPS_SENDFILE | AIM_CAPS_ICQUTF8; 98 static int caps_icq = AIM_CAPS_BUDDYICON | AIM_CAPS_IMIMAGE | AIM_CAPS_SENDFILE | AIM_CAPS_ICQUTF8;
99 /* static int caps_icq = AIM_CAPS_ICQ; */ 99 /* static int caps_icq = AIM_CAPS_ICQ; */
100 /* What does AIM_CAPS_ICQ actually mean? -SE */ 100 /* What does AIM_CAPS_ICQ actually mean? -SE */
101 101
102 static fu8_t gaim_features[] = {0x01, 0x01, 0x01, 0x02}; 102 static fu8_t features_aim[] = {0x01, 0x01, 0x01, 0x02};
103 static fu8_t features_icq[] = {0x01, 0x06};
103 104
104 struct oscar_data { 105 struct oscar_data {
105 aim_session_t *sess; 106 aim_session_t *sess;
106 aim_conn_t *conn; 107 aim_conn_t *conn;
107 108
3839 char *who = normalize(name); 3840 char *who = normalize(name);
3840 struct stat st; 3841 struct stat st;
3841 int len; 3842 int len;
3842 3843
3843 args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES; 3844 args.flags = AIM_IMFLAGS_ACK | AIM_IMFLAGS_CUSTOMFEATURES;
3844 if (od->icq) 3845 if (od->icq) {
3846 args.features = features_icq;
3847 args.featureslen = sizeof(features_icq);
3845 args.flags |= AIM_IMFLAGS_OFFLINE; 3848 args.flags |= AIM_IMFLAGS_OFFLINE;
3846 3849 } else {
3847 args.features = gaim_features; 3850 args.features = features_aim;
3848 args.featureslen = sizeof(gaim_features); 3851 args.featureslen = sizeof(features_aim);
3852 }
3849 3853
3850 while (h) { 3854 while (h) {
3851 ir = h->data; 3855 ir = h->data;
3852 if (ir->request && !strcmp(who, ir->user)) 3856 if (ir->request && !strcmp(who, ir->user))
3853 break; 3857 break;
3882 len = strlen(message); 3886 len = strlen(message);
3883 args.flags |= check_encoding(message); 3887 args.flags |= check_encoding(message);
3884 if (args.flags & AIM_IMFLAGS_UNICODE) { 3888 if (args.flags & AIM_IMFLAGS_UNICODE) {
3885 debug_printf("Sending Unicode IM\n"); 3889 debug_printf("Sending Unicode IM\n");
3886 args.charset = 0x0002; 3890 args.charset = 0x0002;
3887 args.charsubset = 0x0002; 3891 args.charsubset = 0x0000;
3888 args.msg = g_convert(message, len, "UCS-2BE", "UTF-8", NULL, &len, &err); 3892 args.msg = g_convert(message, len, "UCS-2BE", "UTF-8", NULL, &len, &err);
3889 if (err) { 3893 if (err) {
3890 debug_printf("Error converting a unicode message: %s\n", err->message); 3894 debug_printf("Error converting a unicode message: %s\n", err->message);
3891 debug_printf("This really shouldn't happen!\n"); 3895 debug_printf("This really shouldn't happen!\n");
3892 /* We really shouldn't try to send the 3896 /* We really shouldn't try to send the
3893 * IM now, but I'm not sure what to do */ 3897 * IM now, but I'm not sure what to do */
3894 } 3898 }
3895 } else if (args.flags & AIM_IMFLAGS_ISO_8859_1) { 3899 } else if (args.flags & AIM_IMFLAGS_ISO_8859_1) {
3896 debug_printf("Sending ISO-8859-1 IM\n"); 3900 debug_printf("Sending ISO-8859-1 IM\n");
3897 args.charset = 0x0003; 3901 args.charset = 0x0003;
3898 args.charsubset = 0x0003; 3902 args.charsubset = 0x0000;
3899 args.msg = g_convert(message, len, "ISO-8859-1", "UTF-8", NULL, &len, &err); 3903 args.msg = g_convert(message, len, "ISO-8859-1", "UTF-8", NULL, &len, &err);
3900 if (err) { 3904 if (err) {
3901 debug_printf("conversion error: %s\n", err->message); 3905 debug_printf("conversion error: %s\n", err->message);
3902 debug_printf("Someone tell Ethan his 8859-1 detection is wrong\n"); 3906 debug_printf("Someone tell Ethan his 8859-1 detection is wrong\n");
3903 args.flags ^= AIM_IMFLAGS_ISO_8859_1 | AIM_IMFLAGS_UNICODE; 3907 args.flags ^= AIM_IMFLAGS_ISO_8859_1 | AIM_IMFLAGS_UNICODE;

mercurial