comparison src/oscar.c @ 248:cfc73b8501a7

[gaim-migrate @ 258] Oscar chat is there now. Adam will be happy, that's the only thing he asked me specifically about. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 21 May 2000 11:58:18 +0000
parents f6e8ea29b24f
children 810c595258c8
comparison
equal deleted inserted replaced
247:f6e8ea29b24f 248:cfc73b8501a7
371 debug_print("chatnav: connected\n"); 371 debug_print("chatnav: connected\n");
372 break; 372 break;
373 case 0xe: /* Chat */ 373 case 0xe: /* Chat */
374 { 374 {
375 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip); 375 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip);
376 static int id = 1;
376 char *roomname = va_arg(ap, char *); 377 char *roomname = va_arg(ap, char *);
377 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { 378 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) {
378 debug_print("unable to connect to chat server\n"); 379 debug_print("unable to connect to chat server\n");
379 return 1; 380 return 1;
380 } 381 }
381 aim_chat_attachname(tstconn, roomname); 382 aim_chat_attachname(tstconn, roomname);
382 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); 383 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
383 aim_auth_sendcookie(sess, tstconn, cookie); 384 aim_auth_sendcookie(sess, tstconn, cookie);
385 serv_got_joined_chat(id++, roomname);
384 } 386 }
385 break; 387 break;
386 default: /* huh? */ 388 default: /* huh? */
387 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", 389 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n",
388 serviceid); 390 serviceid);
551 } 553 }
552 554
553 int gaim_chatnav_info(struct aim_session_t *sess, 555 int gaim_chatnav_info(struct aim_session_t *sess,
554 struct command_rx_struct *command, ...) { 556 struct command_rx_struct *command, ...) {
555 /* FIXME */ 557 /* FIXME */
558 debug_print("inside chatnav_info\n");
556 return 1; 559 return 1;
557 } 560 }
558 561
559 int gaim_chat_join(struct aim_session_t *sess, 562 int gaim_chat_join(struct aim_session_t *sess,
560 struct command_rx_struct *command, ...) { 563 struct command_rx_struct *command, ...) {
561 /* FIXME */ 564 va_list ap;
565 int count, i = 0;
566 struct aim_userinfo_s *info;
567
568 GList *bcs = buddy_chats;
569 struct buddy_chat *b = NULL;
570
571 va_start(ap, command);
572 count = va_arg(ap, int);
573 info = va_arg(ap, struct aim_userinfo_s *);
574 va_end(ap);
575
576 while(bcs) {
577 b = (struct buddy_chat *)bcs->data;
578 if (!strcasecmp(b->name, (char *)command->conn->priv))
579 break;
580 bcs = bcs->next;
581 b = NULL;
582 }
583 if (!b)
584 return 1;
585
586 while (i < count)
587 add_chat_buddy(b, info[i++].sn);
588
562 return 1; 589 return 1;
563 } 590 }
564 591
565 int gaim_chat_leave(struct aim_session_t *sess, 592 int gaim_chat_leave(struct aim_session_t *sess,
566 struct command_rx_struct *command, ...) { 593 struct command_rx_struct *command, ...) {
567 /* FIXME */ 594 va_list ap;
595 int count, i = 0;
596 struct aim_userinfo_s *info;
597
598 GList *bcs = buddy_chats;
599 struct buddy_chat *b = NULL;
600
601 va_start(ap, command);
602 count = va_arg(ap, int);
603 info = va_arg(ap, struct aim_userinfo_s *);
604 va_end(ap);
605
606 while(bcs) {
607 b = (struct buddy_chat *)bcs->data;
608 if (!strcasecmp(b->name, (char *)command->conn->priv))
609 break;
610 bcs = bcs->next;
611 b = NULL;
612 }
613 if (!b)
614 return 1;
615
616 while (i < count)
617 remove_chat_buddy(b, info[i++].sn);
618
568 return 1; 619 return 1;
569 } 620 }
570 621
571 int gaim_chat_info_update(struct aim_session_t *sess, 622 int gaim_chat_info_update(struct aim_session_t *sess,
572 struct command_rx_struct *command, ...) { 623 struct command_rx_struct *command, ...) {
573 /* FIXME */ 624 /* FIXME */
625 debug_print("inside chat_info_update\n");
574 return 1; 626 return 1;
575 } 627 }
576 628
577 int gaim_chat_incoming_msg(struct aim_session_t *sess, 629 int gaim_chat_incoming_msg(struct aim_session_t *sess,
578 struct command_rx_struct *command, ...) { 630 struct command_rx_struct *command, ...) {
579 /* FIXME */ 631 va_list ap;
632 struct aim_userinfo_s *info;
633 char *msg;
634
635 GList *bcs = buddy_chats;
636 struct buddy_chat *b = NULL;
637
638 va_start(ap, command);
639 info = va_arg(ap, struct aim_userinfo_s *);
640 msg = va_arg(ap, char *);
641
642 while(bcs) {
643 b = (struct buddy_chat *)bcs->data;
644 if (!strcasecmp(b->name, (char *)command->conn->priv))
645 break;
646 bcs = bcs->next;
647 b = NULL;
648 }
649 if (!b)
650 return;
651
652 serv_got_chat_in(b->id, info->sn, 0, msg);
653
580 return 1; 654 return 1;
581 } 655 }
582 656
583 #endif /* USE_OSCAR */ 657 #endif /* USE_OSCAR */