comparison src/protocols/oscar/chat.c @ 4901:ad589b887af9

[gaim-migrate @ 5235] Aside from shifting lots of stuff around in aim.h, mostly just to annoy people because everything in the oscar directory will recompile, I took out a few calls to aimutil_getbleh and aimutil_putbleh in favor of other methods. These functions should be used aaas little as possible because, um, well mid said so in his comments, I think. The only real change is a fix for bug 710933, which says that "Web Aware" is not set at signon, it is only set when you explicitly set your status to anything. Also, the I think the interoperability flag changes how privacy/invisibility in ICQ works, and I'm not really sure if it's good or not. I think it's more like AIM, but I'm too tired to figure out what that means. http://sourceforge.net/tracker/index.php?func=detail&aid=710993&group_id=235&atid=100235 committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 28 Mar 2003 06:37:21 +0000
parents 2532f1192da3
children 09f7f23dc83a
comparison
equal deleted inserted replaced
4900:53718dbe8d0d 4901:ad589b887af9
202 return -ENOMEM; 202 return -ENOMEM;
203 203
204 snacid = aim_cachesnac(sess, 0x0004, 0x0006, 0x0000, sn, strlen(sn)+1); 204 snacid = aim_cachesnac(sess, 0x0004, 0x0006, 0x0000, sn, strlen(sn)+1);
205 aim_putsnac(&fr->data, 0x0004, 0x0006, 0x0000, snacid); 205 aim_putsnac(&fr->data, 0x0004, 0x0006, 0x0000, snacid);
206 206
207
208 /* 207 /*
209 * Cookie 208 * Cookie
210 */ 209 */
211 for (i = 0; i < sizeof(ckstr); i++) 210 for (i = 0; i < 8; i++)
212 aimutil_put8(ckstr, (fu8_t) rand()); 211 ckstr[i] = (fu8_t)rand();
213 212
214 /* XXX should be uncached by an unwritten 'invite accept' handler */ 213 /* XXX should be uncached by an unwritten 'invite accept' handler */
215 if ((priv = malloc(sizeof(struct aim_invite_priv)))) { 214 if ((priv = malloc(sizeof(struct aim_invite_priv)))) {
216 priv->sn = strdup(sn); 215 priv->sn = strdup(sn);
217 priv->roomname = strdup(roomname); 216 priv->roomname = strdup(roomname);
222 if ((cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_INVITE, priv))) 221 if ((cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_INVITE, priv)))
223 aim_cachecookie(sess, cookie); 222 aim_cachecookie(sess, cookie);
224 else 223 else
225 free(priv); 224 free(priv);
226 225
227 for (i = 0; i < sizeof(ckstr); i++) 226 /* ICBM Header */
228 aimbs_put8(&fr->data, ckstr[i]); 227 aimbs_putraw(&fr->data, ckstr, 8); /* Cookie */
229 228 aimbs_put16(&fr->data, 0x0002); /* Channel */
230 229 aimbs_put8(&fr->data, strlen(sn)); /* Screename length */
231 /* 230 aimbs_putraw(&fr->data, sn, strlen(sn)); /* Screenname */
232 * Channel (2)
233 */
234 aimbs_put16(&fr->data, 0x0002);
235
236 /*
237 * Dest sn
238 */
239 aimbs_put8(&fr->data, strlen(sn));
240 aimbs_putraw(&fr->data, sn, strlen(sn));
241 231
242 /* 232 /*
243 * TLV t(0005) 233 * TLV t(0005)
244 * 234 *
245 * Everything else is inside this TLV. 235 * Everything else is inside this TLV.
495 return -ENOMEM; 485 return -ENOMEM;
496 486
497 snacid = aim_cachesnac(sess, 0x000e, 0x0005, 0x0000, NULL, 0); 487 snacid = aim_cachesnac(sess, 0x000e, 0x0005, 0x0000, NULL, 0);
498 aim_putsnac(&fr->data, 0x000e, 0x0005, 0x0000, snacid); 488 aim_putsnac(&fr->data, 0x000e, 0x0005, 0x0000, snacid);
499 489
500 490 /*
501 /* 491 * Cookie
502 * Generate a random message cookie.
503 * 492 *
504 * XXX mkcookie should generate the cookie and cache it in one 493 * XXX mkcookie should generate the cookie and cache it in one
505 * operation to preserve uniqueness. 494 * operation to preserve uniqueness.
506 * 495 */
507 */ 496 for (i = 0; i < 8; i++)
508 for (i = 0; i < sizeof(ckstr); i++) 497 ckstr[i] = (fu8_t)rand();
509 aimutil_put8(ckstr+i, (fu8_t) rand());
510 498
511 cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_CHAT, NULL); 499 cookie = aim_mkcookie(ckstr, AIM_COOKIETYPE_CHAT, NULL);
512 cookie->data = NULL; /* XXX store something useful here */ 500 cookie->data = NULL; /* XXX store something useful here */
513 501
514 aim_cachecookie(sess, cookie); 502 aim_cachecookie(sess, cookie);
515 503
516 for (i = 0; i < sizeof(ckstr); i++) 504 /* ICBM Header */
517 aimbs_put8(&fr->data, ckstr[i]); 505 aimbs_putraw(&fr->data, ckstr, 8); /* Cookie */
518 506 aimbs_put16(&fr->data, 0x0003); /* Channel */
519
520 /*
521 * Channel ID.
522 */
523 aimbs_put16(&fr->data, 0x0003);
524
525 507
526 /* 508 /*
527 * Type 1: Flag meaning this message is destined to the room. 509 * Type 1: Flag meaning this message is destined to the room.
528 */ 510 */
529 aim_addtlvtochain_noval(&otl, 0x0001); 511 aim_addtlvtochain_noval(&otl, 0x0001);