comparison src/protocols/oscar/rxhandlers.c @ 2675:e759254b29bb

[gaim-migrate @ 2688] This source code was developed using Microsoft Visual Studio 6.0. committer: Tailor Script <tailor@pidgin.im>
author Adam Fritzler <mid@auk.cx>
date Mon, 05 Nov 2001 12:25:22 +0000
parents c41030cfed76
children 07283934dedd
comparison
equal deleted inserted replaced
2674:de99ce38ad1f 2675:e759254b29bb
368 } 368 }
369 369
370 return 1; 370 return 1;
371 } 371 }
372 372
373 /*
374 * Some SNACs we do not allow to be hooked, for good reason.
375 */
376 static int checkdisallowed(fu16_t group, fu16_t type)
377 {
378 static const struct {
379 fu16_t group;
380 fu16_t type;
381 } dontuse[] = {
382 {0x0001, 0x0002},
383 {0x0001, 0x0003},
384 {0x0001, 0x0006},
385 {0x0001, 0x0007},
386 {0x0001, 0x0008},
387 {0x0001, 0x0017},
388 {0x0001, 0x0018},
389 {0x0000, 0x0000}
390 };
391 int i;
392
393 for (i = 0; dontuse[i].group != 0x0000; i++) {
394 if ((dontuse[i].group == group) && (dontuse[i].type == type))
395 return 1;
396 }
397
398 return 0;
399 }
400
373 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags) 401 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags)
374 { 402 {
375 struct aim_rxcblist_s *newcb; 403 struct aim_rxcblist_s *newcb;
376 404
377 if (!conn) 405 if (!conn)
378 return -1; 406 return -1;
379 407
380 faimdprintf(sess, 1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type); 408 faimdprintf(sess, 1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type);
409
410 if (checkdisallowed(family, type)) {
411 faimdprintf(sess, 0, "aim_conn_addhandler: client tried to hook %x/%x -- BUG!!!\n", family, type);
412 return -1;
413 }
381 414
382 if (!(newcb = (struct aim_rxcblist_s *)calloc(1, sizeof(struct aim_rxcblist_s)))) 415 if (!(newcb = (struct aim_rxcblist_s *)calloc(1, sizeof(struct aim_rxcblist_s))))
383 return -1; 416 return -1;
384 417
385 newcb->family = family; 418 newcb->family = family;