comparison src/conversation.c @ 4465:6e37eb000b7a

[gaim-migrate @ 4740] Renamed _ops to _ui_ops for conversation-related stuff. Trying to standardize on a naming scheme before I do anything else. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 30 Jan 2003 01:43:35 +0000
parents be8f9ca74ddf
children 7d24d409d710
comparison
equal deleted inserted replaced
4464:e926d3bdfd14 4465:6e37eb000b7a
159 static void 159 static void
160 common_send(struct gaim_conversation *conv, const char *message) 160 common_send(struct gaim_conversation *conv, const char *message)
161 { 161 {
162 GaimConversationType type; 162 GaimConversationType type;
163 struct gaim_connection *gc; 163 struct gaim_connection *gc;
164 struct gaim_conversation_ops *ops; 164 struct gaim_conversation_ui_ops *ops;
165 char *buf, *buf2, *buffy; 165 char *buf, *buf2, *buffy;
166 gulong length = 0; 166 gulong length = 0;
167 gboolean binary = FALSE; 167 gboolean binary = FALSE;
168 int plugin_return; 168 int plugin_return;
169 int limit; 169 int limit;
172 172
173 if ((gc = gaim_conversation_get_gc(conv)) == NULL) 173 if ((gc = gaim_conversation_get_gc(conv)) == NULL)
174 return; 174 return;
175 175
176 type = gaim_conversation_get_type(conv); 176 type = gaim_conversation_get_type(conv);
177 ops = gaim_conversation_get_ops(conv); 177 ops = gaim_conversation_get_ui_ops(conv);
178 178
179 limit = 32 * 1024; /* You shouldn't be sending more than 32K in your 179 limit = 32 * 1024; /* You shouldn't be sending more than 32K in your
180 messages. That's a book. */ 180 messages. That's a book. */
181 181
182 buf = g_malloc(limit); 182 buf = g_malloc(limit);
425 struct gaim_window *win; 425 struct gaim_window *win;
426 426
427 win = g_malloc0(sizeof(struct gaim_window)); 427 win = g_malloc0(sizeof(struct gaim_window));
428 428
429 /* CONV XXX */ 429 /* CONV XXX */
430 win->ops = gaim_get_gtk_window_ops(); 430 win->ui_ops = gaim_get_gtk_window_ui_ops();
431 431
432 if (win->ops != NULL && win->ops->new_window != NULL) 432 if (win->ui_ops != NULL && win->ui_ops->new_window != NULL)
433 win->ops->new_window(win); 433 win->ui_ops->new_window(win);
434 434
435 windows = g_list_append(windows, win); 435 windows = g_list_append(windows, win);
436 436
437 return win; 437 return win;
438 } 438 }
439 439
440 void 440 void
441 gaim_window_destroy(struct gaim_window *win) 441 gaim_window_destroy(struct gaim_window *win)
442 { 442 {
443 struct gaim_window_ops *ops; 443 struct gaim_window_ui_ops *ops;
444 GList *node; 444 GList *node;
445 445
446 if (win == NULL) 446 if (win == NULL)
447 return; 447 return;
448 448
449 ops = gaim_window_get_ops(win); 449 ops = gaim_window_get_ui_ops(win);
450 450
451 for (node = g_list_first(gaim_window_get_conversations(win)); 451 for (node = g_list_first(gaim_window_get_conversations(win));
452 node != NULL; 452 node != NULL;
453 node = g_list_next(node)) 453 node = g_list_next(node))
454 { 454 {
473 } 473 }
474 474
475 void 475 void
476 gaim_window_show(struct gaim_window *win) 476 gaim_window_show(struct gaim_window *win)
477 { 477 {
478 struct gaim_window_ops *ops; 478 struct gaim_window_ui_ops *ops;
479 479
480 if (win == NULL) 480 if (win == NULL)
481 return; 481 return;
482 482
483 ops = gaim_window_get_ops(win); 483 ops = gaim_window_get_ui_ops(win);
484 484
485 if (ops == NULL || ops->show == NULL) 485 if (ops == NULL || ops->show == NULL)
486 return; 486 return;
487 487
488 ops->show(win); 488 ops->show(win);
489 } 489 }
490 490
491 void 491 void
492 gaim_window_hide(struct gaim_window *win) 492 gaim_window_hide(struct gaim_window *win)
493 { 493 {
494 struct gaim_window_ops *ops; 494 struct gaim_window_ui_ops *ops;
495 495
496 if (win == NULL) 496 if (win == NULL)
497 return; 497 return;
498 498
499 ops = gaim_window_get_ops(win); 499 ops = gaim_window_get_ui_ops(win);
500 500
501 if (ops == NULL || ops->hide == NULL) 501 if (ops == NULL || ops->hide == NULL)
502 return; 502 return;
503 503
504 ops->hide(win); 504 ops->hide(win);
505 } 505 }
506 506
507 void 507 void
508 gaim_window_raise(struct gaim_window *win) 508 gaim_window_raise(struct gaim_window *win)
509 { 509 {
510 struct gaim_window_ops *ops; 510 struct gaim_window_ui_ops *ops;
511 511
512 if (win == NULL) 512 if (win == NULL)
513 return; 513 return;
514 514
515 ops = gaim_window_get_ops(win); 515 ops = gaim_window_get_ui_ops(win);
516 516
517 if (ops == NULL || ops->raise == NULL) 517 if (ops == NULL || ops->raise == NULL)
518 return; 518 return;
519 519
520 ops->raise(win); 520 ops->raise(win);
521 } 521 }
522 522
523 void 523 void
524 gaim_window_flash(struct gaim_window *win) 524 gaim_window_flash(struct gaim_window *win)
525 { 525 {
526 struct gaim_window_ops *ops; 526 struct gaim_window_ui_ops *ops;
527 527
528 if (win == NULL) 528 if (win == NULL)
529 return; 529 return;
530 530
531 ops = gaim_window_get_ops(win); 531 ops = gaim_window_get_ui_ops(win);
532 532
533 if (ops == NULL || ops->flash == NULL) 533 if (ops == NULL || ops->flash == NULL)
534 return; 534 return;
535 535
536 ops->flash(win); 536 ops->flash(win);
537 } 537 }
538 538
539 void 539 void
540 gaim_window_set_ops(struct gaim_window *win, struct gaim_window_ops *ops) 540 gaim_window_set_ui_ops(struct gaim_window *win, struct gaim_window_ui_ops *ops)
541 { 541 {
542 struct gaim_conversation_ops *convops = NULL; 542 struct gaim_conversation_ui_ops *conv_ops = NULL;
543 GList *l; 543 GList *l;
544 544
545 if (win == NULL || win->ops == ops) 545 if (win == NULL || win->ui_ops == ops)
546 return; 546 return;
547 547
548 if (ops != NULL) { 548 if (ops != NULL) {
549 if (ops->get_conversation_ops != NULL) 549 if (ops->get_conversation_ui_ops != NULL)
550 convops = ops->get_conversation_ops(); 550 conv_ops = ops->get_conversation_ui_ops();
551 } 551 }
552 552
553 if (win->ops != NULL) { 553 if (win->ui_ops != NULL) {
554 if (win->ops->destroy_window != NULL) 554 if (win->ui_ops->destroy_window != NULL)
555 win->ops->destroy_window(win); 555 win->ui_ops->destroy_window(win);
556 } 556 }
557 557
558 win->ops = ops; 558 win->ui_ops = ops;
559 559
560 if (win->ops != NULL) { 560 if (win->ui_ops != NULL) {
561 if (win->ops->new_window != NULL) 561 if (win->ui_ops->new_window != NULL)
562 win->ops->new_window(win); 562 win->ui_ops->new_window(win);
563 } 563 }
564 564
565 for (l = gaim_window_get_conversations(win); 565 for (l = gaim_window_get_conversations(win);
566 l != NULL; 566 l != NULL;
567 l = l->next) { 567 l = l->next) {
568 568
569 struct gaim_conversation *conv = (struct gaim_conversation *)l; 569 struct gaim_conversation *conv = (struct gaim_conversation *)l;
570 570
571 gaim_conversation_set_ops(conv, convops); 571 gaim_conversation_set_ui_ops(conv, conv_ops);
572 572
573 if (win->ops != NULL && win->ops->add_conversation != NULL) 573 if (win->ui_ops != NULL && win->ui_ops->add_conversation != NULL)
574 win->ops->add_conversation(win, conv); 574 win->ui_ops->add_conversation(win, conv);
575 } 575 }
576 } 576 }
577 577
578 struct gaim_window_ops * 578 struct gaim_window_ui_ops *
579 gaim_window_get_ops(const struct gaim_window *win) 579 gaim_window_get_ui_ops(const struct gaim_window *win)
580 { 580 {
581 if (win == NULL) 581 if (win == NULL)
582 return NULL; 582 return NULL;
583 583
584 return win->ops; 584 return win->ui_ops;
585 } 585 }
586 586
587 int 587 int
588 gaim_window_add_conversation(struct gaim_window *win, 588 gaim_window_add_conversation(struct gaim_window *win,
589 struct gaim_conversation *conv) 589 struct gaim_conversation *conv)
590 { 590 {
591 struct gaim_window_ops *ops; 591 struct gaim_window_ui_ops *ops;
592 592
593 if (win == NULL || conv == NULL) 593 if (win == NULL || conv == NULL)
594 return -1; 594 return -1;
595 595
596 if (gaim_conversation_get_window(conv) != NULL) { 596 if (gaim_conversation_get_window(conv) != NULL) {
597 gaim_window_remove_conversation( 597 gaim_window_remove_conversation(
598 gaim_conversation_get_window(conv), 598 gaim_conversation_get_window(conv),
599 gaim_conversation_get_index(conv)); 599 gaim_conversation_get_index(conv));
600 } 600 }
601 601
602 ops = gaim_window_get_ops(win); 602 ops = gaim_window_get_ui_ops(win);
603 603
604 win->conversations = g_list_append(win->conversations, conv); 604 win->conversations = g_list_append(win->conversations, conv);
605 win->conversation_count++; 605 win->conversation_count++;
606 606
607 conv->conversation_pos = win->conversation_count - 1; 607 conv->conversation_pos = win->conversation_count - 1;
608 608
609 if (ops != NULL) { 609 if (ops != NULL) {
610 conv->window = win; 610 conv->window = win;
611 611
612 if (ops->get_conversation_ops != NULL) 612 if (ops->get_conversation_ui_ops != NULL)
613 gaim_conversation_set_ops(conv, ops->get_conversation_ops()); 613 gaim_conversation_set_ui_ops(conv, ops->get_conversation_ui_ops());
614 614
615 if (ops->add_conversation != NULL) 615 if (ops->add_conversation != NULL)
616 ops->add_conversation(win, conv); 616 ops->add_conversation(win, conv);
617 } 617 }
618 618
620 } 620 }
621 621
622 struct gaim_conversation * 622 struct gaim_conversation *
623 gaim_window_remove_conversation(struct gaim_window *win, unsigned int index) 623 gaim_window_remove_conversation(struct gaim_window *win, unsigned int index)
624 { 624 {
625 struct gaim_window_ops *ops; 625 struct gaim_window_ui_ops *ops;
626 struct gaim_conversation *conv; 626 struct gaim_conversation *conv;
627 GList *node; 627 GList *node;
628 628
629 if (win == NULL || index >= gaim_window_get_conversation_count(win)) 629 if (win == NULL || index >= gaim_window_get_conversation_count(win))
630 return NULL; 630 return NULL;
631 631
632 ops = gaim_window_get_ops(win); 632 ops = gaim_window_get_ui_ops(win);
633 633
634 node = g_list_nth(gaim_window_get_conversations(win), index); 634 node = g_list_nth(gaim_window_get_conversations(win), index);
635 conv = (struct gaim_conversation *)node->data; 635 conv = (struct gaim_conversation *)node->data;
636 636
637 if (ops != NULL && ops->remove_conversation != NULL) 637 if (ops != NULL && ops->remove_conversation != NULL)
657 657
658 void 658 void
659 gaim_window_move_conversation(struct gaim_window *win, unsigned int index, 659 gaim_window_move_conversation(struct gaim_window *win, unsigned int index,
660 unsigned int new_index) 660 unsigned int new_index)
661 { 661 {
662 struct gaim_window_ops *ops; 662 struct gaim_window_ui_ops *ops;
663 struct gaim_conversation *conv; 663 struct gaim_conversation *conv;
664 GList *l; 664 GList *l;
665 665
666 if (win == NULL || index >= gaim_window_get_conversation_count(win) || 666 if (win == NULL || index >= gaim_window_get_conversation_count(win) ||
667 index == new_index) 667 index == new_index)
682 } 682 }
683 683
684 conv = (struct gaim_conversation *)l->data; 684 conv = (struct gaim_conversation *)l->data;
685 685
686 /* Update the UI part of this. */ 686 /* Update the UI part of this. */
687 ops = gaim_window_get_ops(win); 687 ops = gaim_window_get_ui_ops(win);
688 688
689 if (ops != NULL && ops->move_conversation != NULL) 689 if (ops != NULL && ops->move_conversation != NULL)
690 ops->move_conversation(win, conv, new_index); 690 ops->move_conversation(win, conv, new_index);
691 691
692 if (new_index > index) 692 if (new_index > index)
722 } 722 }
723 723
724 void 724 void
725 gaim_window_switch_conversation(struct gaim_window *win, unsigned int index) 725 gaim_window_switch_conversation(struct gaim_window *win, unsigned int index)
726 { 726 {
727 struct gaim_window_ops *ops; 727 struct gaim_window_ui_ops *ops;
728 728
729 if (win == NULL || index < 0 || 729 if (win == NULL || index < 0 ||
730 index >= gaim_window_get_conversation_count(win)) 730 index >= gaim_window_get_conversation_count(win))
731 return; 731 return;
732 732
733 ops = gaim_window_get_ops(win); 733 ops = gaim_window_get_ui_ops(win);
734 734
735 if (ops != NULL && ops->switch_conversation != NULL) 735 if (ops != NULL && ops->switch_conversation != NULL)
736 ops->switch_conversation(win, index); 736 ops->switch_conversation(win, index);
737 737
738 gaim_conversation_set_unseen( 738 gaim_conversation_set_unseen(
740 } 740 }
741 741
742 struct gaim_conversation * 742 struct gaim_conversation *
743 gaim_window_get_active_conversation(const struct gaim_window *win) 743 gaim_window_get_active_conversation(const struct gaim_window *win)
744 { 744 {
745 struct gaim_window_ops *ops; 745 struct gaim_window_ui_ops *ops;
746 746
747 if (win == NULL) 747 if (win == NULL)
748 return NULL; 748 return NULL;
749 749
750 ops = gaim_window_get_ops(win); 750 ops = gaim_window_get_ui_ops(win);
751 751
752 if (ops != NULL && ops->get_active_index != NULL) 752 if (ops != NULL && ops->get_active_index != NULL)
753 return gaim_window_get_conversation_at(win, ops->get_active_index(win)); 753 return gaim_window_get_conversation_at(win, ops->get_active_index(win));
754 754
755 return NULL; 755 return NULL;
851 851
852 void 852 void
853 gaim_conversation_destroy(struct gaim_conversation *conv) 853 gaim_conversation_destroy(struct gaim_conversation *conv)
854 { 854 {
855 struct gaim_window *win; 855 struct gaim_window *win;
856 struct gaim_conversation_ops *ops; 856 struct gaim_conversation_ui_ops *ops;
857 struct gaim_connection *gc; 857 struct gaim_connection *gc;
858 const char *name; 858 const char *name;
859 GList *node; 859 GList *node;
860 860
861 if (conv == NULL) 861 if (conv == NULL)
862 return; 862 return;
863 863
864 win = gaim_conversation_get_window(conv); 864 win = gaim_conversation_get_window(conv);
865 ops = gaim_conversation_get_ops(conv); 865 ops = gaim_conversation_get_ui_ops(conv);
866 gc = gaim_conversation_get_gc(conv); 866 gc = gaim_conversation_get_gc(conv);
867 name = gaim_conversation_get_name(conv); 867 name = gaim_conversation_get_name(conv);
868 868
869 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) { 869 if (gaim_conversation_get_type(conv) == GAIM_CONV_IM) {
870 if (!(misc_options & OPT_MISC_STEALTH_TYPING)) 870 if (!(misc_options & OPT_MISC_STEALTH_TYPING))
961 961
962 return conv->type; 962 return conv->type;
963 } 963 }
964 964
965 void 965 void
966 gaim_conversation_set_ops(struct gaim_conversation *conv, 966 gaim_conversation_set_ui_ops(struct gaim_conversation *conv,
967 struct gaim_conversation_ops *ops) 967 struct gaim_conversation_ui_ops *ops)
968 { 968 {
969 if (conv == NULL || conv->ops == ops) 969 if (conv == NULL || conv->ui_ops == ops)
970 return; 970 return;
971 971
972 if (conv->ops != NULL && conv->ops->destroy_conversation != NULL) 972 if (conv->ui_ops != NULL && conv->ui_ops->destroy_conversation != NULL)
973 conv->ops->destroy_conversation(conv); 973 conv->ui_ops->destroy_conversation(conv);
974 974
975 conv->ui_data = NULL; 975 conv->ui_data = NULL;
976 976
977 conv->ops = ops; 977 conv->ui_ops = ops;
978 } 978 }
979 979
980 struct gaim_conversation_ops * 980 struct gaim_conversation_ui_ops *
981 gaim_conversation_get_ops(struct gaim_conversation *conv) 981 gaim_conversation_get_ui_ops(struct gaim_conversation *conv)
982 { 982 {
983 if (conv == NULL) 983 if (conv == NULL)
984 return NULL; 984 return NULL;
985 985
986 return conv->ops; 986 return conv->ui_ops;
987 } 987 }
988 988
989 void 989 void
990 gaim_conversation_set_user(struct gaim_conversation *conv, 990 gaim_conversation_set_user(struct gaim_conversation *conv,
991 struct aim_user *user) 991 struct aim_user *user)
1024 } 1024 }
1025 1025
1026 void 1026 void
1027 gaim_conversation_set_title(struct gaim_conversation *conv, const char *title) 1027 gaim_conversation_set_title(struct gaim_conversation *conv, const char *title)
1028 { 1028 {
1029 struct gaim_conversation_ops *ops; 1029 struct gaim_conversation_ui_ops *ops;
1030 1030
1031 if (conv == NULL || title == NULL) 1031 if (conv == NULL || title == NULL)
1032 return; 1032 return;
1033 1033
1034 if (conv->title != NULL) 1034 if (conv->title != NULL)
1035 g_free(conv->title); 1035 g_free(conv->title);
1036 1036
1037 conv->title = g_strdup(title); 1037 conv->title = g_strdup(title);
1038 1038
1039 ops = gaim_conversation_get_ops(conv); 1039 ops = gaim_conversation_get_ui_ops(conv);
1040 1040
1041 if (ops != NULL && ops->set_title != NULL) 1041 if (ops != NULL && ops->set_title != NULL)
1042 ops->set_title(conv, conv->title); 1042 ops->set_title(conv, conv->title);
1043 } 1043 }
1044 1044
1288 gaim_conversation_write(struct gaim_conversation *conv, const char *who, 1288 gaim_conversation_write(struct gaim_conversation *conv, const char *who,
1289 const char *message, size_t length, int flags, 1289 const char *message, size_t length, int flags,
1290 time_t mtime) 1290 time_t mtime)
1291 { 1291 {
1292 struct gaim_connection *gc; 1292 struct gaim_connection *gc;
1293 struct gaim_conversation_ops *ops; 1293 struct gaim_conversation_ui_ops *ops;
1294 struct gaim_window *win; 1294 struct gaim_window *win;
1295 struct buddy *b; 1295 struct buddy *b;
1296 GaimUnseenState unseen; 1296 GaimUnseenState unseen;
1297 /* int logging_font_options = 0; */ 1297 /* int logging_font_options = 0; */
1298 1298
1299 if (conv == NULL || message == NULL) 1299 if (conv == NULL || message == NULL)
1300 return; 1300 return;
1301 1301
1302 ops = gaim_conversation_get_ops(conv); 1302 ops = gaim_conversation_get_ui_ops(conv);
1303 1303
1304 if (ops == NULL || ops->write_conv == NULL) 1304 if (ops == NULL || ops->write_conv == NULL)
1305 return; 1305 return;
1306 1306
1307 gc = gaim_conversation_get_gc(conv); 1307 gc = gaim_conversation_get_gc(conv);
1385 1385
1386 void 1386 void
1387 gaim_conversation_update_progress(struct gaim_conversation *conv, 1387 gaim_conversation_update_progress(struct gaim_conversation *conv,
1388 float percent) 1388 float percent)
1389 { 1389 {
1390 struct gaim_conversation_ops *ops; 1390 struct gaim_conversation_ui_ops *ops;
1391 1391
1392 if (conv == NULL) 1392 if (conv == NULL)
1393 return; 1393 return;
1394 1394
1395 if (percent < 0) 1395 if (percent < 0)
1397 1397
1398 /* 1398 /*
1399 * NOTE: A percent >= 1 indicates that the progress bar should be 1399 * NOTE: A percent >= 1 indicates that the progress bar should be
1400 * closed. 1400 * closed.
1401 */ 1401 */
1402 ops = gaim_conversation_get_ops(conv); 1402 ops = gaim_conversation_get_ui_ops(conv);
1403 1403
1404 if (ops != NULL && ops->update_progress != NULL) 1404 if (ops != NULL && ops->update_progress != NULL)
1405 ops->update_progress(conv, percent); 1405 ops->update_progress(conv, percent);
1406 } 1406 }
1407 1407
1408 void 1408 void
1409 gaim_conversation_update(struct gaim_conversation *conv, 1409 gaim_conversation_update(struct gaim_conversation *conv,
1410 GaimConvUpdateType type) 1410 GaimConvUpdateType type)
1411 { 1411 {
1412 struct gaim_conversation_ops *ops; 1412 struct gaim_conversation_ui_ops *ops;
1413 1413
1414 if (conv == NULL) 1414 if (conv == NULL)
1415 return; 1415 return;
1416 1416
1417 ops = gaim_conversation_get_ops(conv); 1417 ops = gaim_conversation_get_ui_ops(conv);
1418 1418
1419 if (ops != NULL && ops->updated != NULL) 1419 if (ops != NULL && ops->updated != NULL)
1420 ops->updated(conv, type); 1420 ops->updated(conv, type);
1421 } 1421 }
1422 1422
1564 1564
1565 /* Raise the window, if specified in prefs. */ 1565 /* Raise the window, if specified in prefs. */
1566 if (!(flags & WFLAG_NOLOG) & (im_options & OPT_IM_POPUP)) 1566 if (!(flags & WFLAG_NOLOG) & (im_options & OPT_IM_POPUP))
1567 gaim_window_raise(gaim_conversation_get_window(c)); 1567 gaim_window_raise(gaim_conversation_get_window(c));
1568 1568
1569 if (c->ops != NULL && c->ops->write_im != NULL) 1569 if (c->ui_ops != NULL && c->ui_ops->write_im != NULL)
1570 c->ops->write_im(c, who, message, len, flags, mtime); 1570 c->ui_ops->write_im(c, who, message, len, flags, mtime);
1571 else 1571 else
1572 gaim_conversation_write(c, who, message, -1, flags, mtime); 1572 gaim_conversation_write(c, who, message, -1, flags, mtime);
1573 } 1573 }
1574 1574
1575 void 1575 void
1792 1792
1793 g_free(str); 1793 g_free(str);
1794 } 1794 }
1795 1795
1796 /* Pass this on to either the ops structure or the default write func. */ 1796 /* Pass this on to either the ops structure or the default write func. */
1797 if (conv->ops != NULL && conv->ops->write_chat != NULL) 1797 if (conv->ui_ops != NULL && conv->ui_ops->write_chat != NULL)
1798 conv->ops->write_chat(conv, who, message, flags, mtime); 1798 conv->ui_ops->write_chat(conv, who, message, flags, mtime);
1799 else 1799 else
1800 gaim_conversation_write(conv, who, message, -1, flags, mtime); 1800 gaim_conversation_write(conv, who, message, -1, flags, mtime);
1801 } 1801 }
1802 1802
1803 void 1803 void
1812 void 1812 void
1813 gaim_chat_add_user(struct gaim_chat *chat, const char *user, 1813 gaim_chat_add_user(struct gaim_chat *chat, const char *user,
1814 const char *extra_msg) 1814 const char *extra_msg)
1815 { 1815 {
1816 struct gaim_conversation *conv; 1816 struct gaim_conversation *conv;
1817 struct gaim_conversation_ops *ops; 1817 struct gaim_conversation_ui_ops *ops;
1818 char tmp[BUF_LONG]; 1818 char tmp[BUF_LONG];
1819 1819
1820 if (chat == NULL || user == NULL) 1820 if (chat == NULL || user == NULL)
1821 return; 1821 return;
1822 1822
1823 conv = gaim_chat_get_conversation(chat); 1823 conv = gaim_chat_get_conversation(chat);
1824 ops = gaim_conversation_get_ops(conv); 1824 ops = gaim_conversation_get_ui_ops(conv);
1825 1825
1826 gaim_chat_set_users(chat, 1826 gaim_chat_set_users(chat,
1827 g_list_insert_sorted(gaim_chat_get_users(chat), g_strdup(user), 1827 g_list_insert_sorted(gaim_chat_get_users(chat), g_strdup(user),
1828 insertname_compare)); 1828 insertname_compare));
1829 1829
1849 void 1849 void
1850 gaim_chat_rename_user(struct gaim_chat *chat, const char *old_user, 1850 gaim_chat_rename_user(struct gaim_chat *chat, const char *old_user,
1851 const char *new_user) 1851 const char *new_user)
1852 { 1852 {
1853 struct gaim_conversation *conv; 1853 struct gaim_conversation *conv;
1854 struct gaim_conversation_ops *ops; 1854 struct gaim_conversation_ui_ops *ops;
1855 char tmp[BUF_LONG]; 1855 char tmp[BUF_LONG];
1856 1856
1857 if (chat == NULL || old_user == NULL || new_user == NULL) 1857 if (chat == NULL || old_user == NULL || new_user == NULL)
1858 return; 1858 return;
1859 1859
1860 conv = gaim_chat_get_conversation(chat); 1860 conv = gaim_chat_get_conversation(chat);
1861 ops = gaim_conversation_get_ops(conv); 1861 ops = gaim_conversation_get_ui_ops(conv);
1862 1862
1863 gaim_chat_set_users(chat, 1863 gaim_chat_set_users(chat,
1864 g_list_insert_sorted(gaim_chat_get_users(chat), g_strdup(new_user), 1864 g_list_insert_sorted(gaim_chat_get_users(chat), g_strdup(new_user),
1865 insertname_compare)); 1865 insertname_compare));
1866 1866
1888 void 1888 void
1889 gaim_chat_remove_user(struct gaim_chat *chat, const char *user, 1889 gaim_chat_remove_user(struct gaim_chat *chat, const char *user,
1890 const char *reason) 1890 const char *reason)
1891 { 1891 {
1892 struct gaim_conversation *conv; 1892 struct gaim_conversation *conv;
1893 struct gaim_conversation_ops *ops; 1893 struct gaim_conversation_ui_ops *ops;
1894 char tmp[BUF_LONG]; 1894 char tmp[BUF_LONG];
1895 GList *names; 1895 GList *names;
1896 1896
1897 if (chat == NULL || user == NULL) 1897 if (chat == NULL || user == NULL)
1898 return; 1898 return;
1899 1899
1900 conv = gaim_chat_get_conversation(chat); 1900 conv = gaim_chat_get_conversation(chat);
1901 ops = gaim_conversation_get_ops(conv); 1901 ops = gaim_conversation_get_ui_ops(conv);
1902 1902
1903 plugin_event(event_chat_buddy_leave, gaim_conversation_get_gc(conv), 1903 plugin_event(event_chat_buddy_leave, gaim_conversation_get_gc(conv),
1904 gaim_chat_get_id(chat), user); 1904 gaim_chat_get_id(chat), user);
1905 1905
1906 if (ops != NULL && ops->chat_remove_user != NULL) 1906 if (ops != NULL && ops->chat_remove_user != NULL)