Mercurial > pidgin
comparison src/server.c @ 692:f4026275bc9f
[gaim-migrate @ 702]
chat mods
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Wed, 16 Aug 2000 01:00:27 +0000 |
parents | 94a27f7567c5 |
children | 30a8e386849d |
comparison
equal
deleted
inserted
replaced
691:104a2659b358 | 692:f4026275bc9f |
---|---|
531 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name); | 531 g_snprintf(buf, sizeof(buf)/2, "toc_chat_join %d \"%s\"", exchange, name); |
532 sflap_send(buf, -1, TYPE_DATA); | 532 sflap_send(buf, -1, TYPE_DATA); |
533 } else { | 533 } else { |
534 sprintf(debug_buff, "Attempting to join chat room %s.\n", name); | 534 sprintf(debug_buff, "Attempting to join chat room %s.\n", name); |
535 debug_print(debug_buff); | 535 debug_print(debug_buff); |
536 aim_chat_join(gaim_sess, gaim_conn, 0x0004, name); | 536 aim_chat_join(gaim_sess, gaim_conn, exchange, name); |
537 } | 537 } |
538 } | 538 } |
539 | 539 |
540 void serv_chat_invite(int id, char *message, char *name) | 540 void serv_chat_invite(int id, char *message, char *name) |
541 { | 541 { |
568 char *buf = g_malloc(256); | 568 char *buf = g_malloc(256); |
569 g_snprintf(buf, 255, "toc_chat_leave %d", id); | 569 g_snprintf(buf, 255, "toc_chat_leave %d", id); |
570 sflap_send(buf, -1, TYPE_DATA); | 570 sflap_send(buf, -1, TYPE_DATA); |
571 g_free(buf); | 571 g_free(buf); |
572 } else { | 572 } else { |
573 GList *bcs = buddy_chats; | 573 GList *bcs = buddy_chats; |
574 struct conversation *b = NULL; | 574 struct conversation *b = NULL; |
575 struct chat_connection *c = NULL; | 575 struct chat_connection *c = NULL; |
576 int count = 0; | 576 int count = 0; |
577 | 577 |
578 while (bcs) { | 578 while (bcs) { |
579 count++; | 579 count++; |
580 b = (struct conversation *)bcs->data; | 580 b = (struct conversation *)bcs->data; |
581 if (id == b->id) | 581 if (id == b->id) |
582 break; | 582 break; |
583 bcs = bcs->next; | 583 bcs = bcs->next; |
584 b = NULL; | 584 b = NULL; |
585 } | 585 } |
586 | 586 |
587 if (!b) | 587 if (!b) |
588 return; | 588 return; |
589 | 589 |
590 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n", | 590 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n", |
591 b->name, count); | 591 b->name, count); |
592 debug_print(debug_buff); | 592 debug_print(debug_buff); |
593 | 593 |
594 aim_chat_leaveroom(gaim_sess, b->name); | 594 aim_chat_leaveroom(gaim_sess, b->name); |
595 c = find_oscar_chat(b->name); | 595 c = find_oscar_chat(b->name); |
596 if (c != NULL) { | 596 if (c != NULL) { |
597 oscar_chats = g_list_remove(oscar_chats, c); | 597 aim_conn_kill(gaim_sess, &c->conn); |
598 gdk_input_remove(c->inpa); | 598 oscar_chats = g_list_remove(oscar_chats, c); |
599 g_free(c->name); | 599 gdk_input_remove(c->inpa); |
600 g_free(c); | 600 g_free(c->name); |
601 } | 601 g_free(c); |
602 /* we do this because with Oscar it doesn't tell us we left */ | 602 } |
603 serv_got_chat_left(b->id); | 603 /* we do this because with Oscar it doesn't tell us we left */ |
604 serv_got_chat_left(b->id); | |
604 } | 605 } |
605 } | 606 } |
606 | 607 |
607 void serv_chat_whisper(int id, char *who, char *message) | 608 void serv_chat_whisper(int id, char *who, char *message) |
608 { | 609 { |
902 int i = (int)gtk_object_get_user_data(GTK_OBJECT(w2)); | 903 int i = (int)gtk_object_get_user_data(GTK_OBJECT(w2)); |
903 serv_accept_chat(i); | 904 serv_accept_chat(i); |
904 gtk_widget_destroy(w2); | 905 gtk_widget_destroy(w2); |
905 } else { | 906 } else { |
906 char *i = (char *)gtk_object_get_user_data(GTK_OBJECT(w2)); | 907 char *i = (char *)gtk_object_get_user_data(GTK_OBJECT(w2)); |
907 serv_join_chat(0, i); /* for oscar, it doesn't use the id anyway */ | 908 serv_join_chat(4, i); |
908 g_free(i); | 909 g_free(i); |
909 gtk_widget_destroy(w2); | 910 gtk_widget_destroy(w2); |
910 } | 911 } |
911 } | 912 } |
912 | 913 |