Mercurial > pidgin
comparison src/protocols/oscar/im.c @ 2626:93f9bbd62630
[gaim-migrate @ 2639]
read CHANGES.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 27 Oct 2001 01:58:12 +0000 |
parents | 1069b0940237 |
children | 4d6a767133e1 |
comparison
equal
deleted
inserted
replaced
2625:d8d2df2bdf01 | 2626:93f9bbd62630 |
---|---|
82 | 82 |
83 return AIM_CLIENTTYPE_UNKNOWN; | 83 return AIM_CLIENTTYPE_UNKNOWN; |
84 } | 84 } |
85 | 85 |
86 /* This should be endian-safe now... but who knows... */ | 86 /* This should be endian-safe now... but who knows... */ |
87 faim_export fu32_t aim_iconsum(const fu8_t *buf, int buflen) | 87 faim_export fu16_t aim_iconsum(const fu8_t *buf, int buflen) |
88 { | 88 { |
89 fu32_t sum; | 89 fu32_t sum; |
90 int i; | 90 int i; |
91 | 91 |
92 for (i = 0, sum = 0; i < buflen; i += 2) | 92 for (i = 0, sum = 0; i < buflen; i += 2) |
93 sum += (buf[i+1] << 8) + buf[i]; | 93 sum += (buf[i+1] << 8) + buf[i]; |
94 | 94 |
95 sum = ((sum & 0xffff0000) >> 16) + (sum & 0x0000ffff); | 95 sum = ((sum & 0xffff0000) >> 16) + (sum & 0x0000ffff); |
96 | 96 |
97 return sum; | 97 return (fu16_t)sum; |
98 } | 98 } |
99 | 99 |
100 /* | 100 /* |
101 * Send an ICBM (instant message). | 101 * Send an ICBM (instant message). |
102 * | 102 * |
312 */ | 312 */ |
313 if (args->flags & AIM_IMFLAGS_HASICON) { | 313 if (args->flags & AIM_IMFLAGS_HASICON) { |
314 aimbs_put16(&fr->data, 0x0008); | 314 aimbs_put16(&fr->data, 0x0008); |
315 aimbs_put16(&fr->data, 0x000c); | 315 aimbs_put16(&fr->data, 0x000c); |
316 aimbs_put32(&fr->data, args->iconlen); | 316 aimbs_put32(&fr->data, args->iconlen); |
317 aimbs_put32(&fr->data, args->iconsum); | 317 aimbs_put16(&fr->data, 0x0001); |
318 aimbs_put16(&fr->data, args->iconsum); | |
318 aimbs_put32(&fr->data, args->iconstamp); | 319 aimbs_put32(&fr->data, args->iconstamp); |
319 } | 320 } |
320 | 321 |
321 aim_tx_enqueue(sess, fr); | 322 aim_tx_enqueue(sess, fr); |
322 | 323 |
354 | 355 |
355 /* | 356 /* |
356 * This is also performance sensitive. (If you can believe it...) | 357 * This is also performance sensitive. (If you can believe it...) |
357 * | 358 * |
358 */ | 359 */ |
359 faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu32_t iconsum) | 360 faim_export int aim_send_icon(aim_session_t *sess, aim_conn_t *conn, const char *sn, const fu8_t *icon, int iconlen, time_t stamp, fu16_t iconsum) |
360 { | 361 { |
361 int i; | 362 int i; |
362 fu8_t ck[8]; | 363 fu8_t ck[8]; |
363 aim_frame_t *fr; | 364 aim_frame_t *fr; |
364 aim_snacid_t snacid; | 365 aim_snacid_t snacid; |
416 aimbs_put16(&fr->data, 0x0000); | 417 aimbs_put16(&fr->data, 0x0000); |
417 | 418 |
418 /* TLV t(2711) */ | 419 /* TLV t(2711) */ |
419 aimbs_put16(&fr->data, 0x2711); | 420 aimbs_put16(&fr->data, 0x2711); |
420 aimbs_put16(&fr->data, 4+4+4+iconlen+strlen(AIM_ICONIDENT)); | 421 aimbs_put16(&fr->data, 4+4+4+iconlen+strlen(AIM_ICONIDENT)); |
421 aimbs_put32(&fr->data, iconsum); | 422 aimbs_put16(&fr->data, 0x0000); |
423 aimbs_put16(&fr->data, iconsum); | |
422 aimbs_put32(&fr->data, iconlen); | 424 aimbs_put32(&fr->data, iconlen); |
423 aimbs_put32(&fr->data, stamp); | 425 aimbs_put32(&fr->data, stamp); |
424 aimbs_putraw(&fr->data, icon, iconlen); | 426 aimbs_putraw(&fr->data, icon, iconlen); |
425 aimbs_putraw(&fr->data, AIM_ICONIDENT, strlen(AIM_ICONIDENT)); | 427 aimbs_putraw(&fr->data, AIM_ICONIDENT, strlen(AIM_ICONIDENT)); |
426 | 428 |
852 | 854 |
853 args.icbmflags |= AIM_IMFLAGS_AWAY; | 855 args.icbmflags |= AIM_IMFLAGS_AWAY; |
854 | 856 |
855 } else if (type == 0x0008) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */ | 857 } else if (type == 0x0008) { /* I-HAVE-A-REALLY-PURTY-ICON Flag */ |
856 | 858 |
857 args.iconsum = aimbs_get32(bs); | |
858 args.iconlen = aimbs_get32(bs); | 859 args.iconlen = aimbs_get32(bs); |
860 aimbs_get16(bs); /* 0x0001 */ | |
861 args.iconsum = aimbs_get16(bs); | |
859 args.iconstamp = aimbs_get32(bs); | 862 args.iconstamp = aimbs_get32(bs); |
860 args.icbmflags |= AIM_IMFLAGS_HASICON; | 863 args.icbmflags |= AIM_IMFLAGS_HASICON; |
861 | 864 |
862 } else if (type == 0x0009) { | 865 } else if (type == 0x0009) { |
863 | 866 |