src/perl.c

changeset 4359
cf899ee07d1d
parent 4349
a65175463a31
child 4432
44107d6ba86d
equal deleted inserted replaced
4358:a6fc799d5c40 4359:cf899ee07d1d
760 } 760 }
761 761
762 XS (XS_GAIM_write_to_conv) 762 XS (XS_GAIM_write_to_conv)
763 { 763 {
764 char *nick, *who, *what; 764 char *nick, *who, *what;
765 struct conversation *c; 765 struct gaim_conversation *c;
766 int junk; 766 int junk;
767 int send, wflags; 767 int send, wflags;
768 dXSARGS; 768 dXSARGS;
769 items = 0; 769 items = 0;
770 770
780 case 1: wflags=WFLAG_RECV; break; 780 case 1: wflags=WFLAG_RECV; break;
781 case 2: wflags=WFLAG_SYSTEM; break; 781 case 2: wflags=WFLAG_SYSTEM; break;
782 default: wflags=WFLAG_RECV; 782 default: wflags=WFLAG_RECV;
783 } 783 }
784 784
785 c = find_conversation(nick); 785 c = gaim_find_conversation(nick);
786
786 if (!c) 787 if (!c)
787 c = new_conversation(nick); 788 c = gaim_conversation_new(GAIM_CONV_IM, nick);
788 789
789 write_to_conv(c, what, wflags, who, time(NULL), -1); 790 gaim_conversation_write(c, who, what, -1, wflags, time(NULL));
790 XSRETURN(0); 791 XSRETURN(0);
791 } 792 }
792 793
793 XS (XS_GAIM_serv_send_im) 794 XS (XS_GAIM_serv_send_im)
794 { 795 {
815 XS (XS_GAIM_print_to_conv) 816 XS (XS_GAIM_print_to_conv)
816 { 817 {
817 struct gaim_connection *gc; 818 struct gaim_connection *gc;
818 char *nick, *what; 819 char *nick, *what;
819 int isauto; 820 int isauto;
820 struct conversation *c; 821 struct gaim_conversation *c;
821 unsigned int junk; 822 unsigned int junk;
822 dXSARGS; 823 dXSARGS;
823 items = 0; 824 items = 0;
824 825
825 gc = (struct gaim_connection *)SvIV(ST(0)); 826 gc = (struct gaim_connection *)SvIV(ST(0));
828 isauto = SvIV(ST(3)); 829 isauto = SvIV(ST(3));
829 if (!g_slist_find(connections, gc)) { 830 if (!g_slist_find(connections, gc)) {
830 XSRETURN(0); 831 XSRETURN(0);
831 return; 832 return;
832 } 833 }
833 c = find_conversation(nick); 834 c = gaim_find_conversation(nick);
834 if (!c) 835 if (!c)
835 c = new_conversation(nick); 836 c = gaim_conversation_new(GAIM_CONV_IM, nick);
836 set_convo_gc(c, gc); 837 gaim_conversation_set_user(c, gc->user);
837 write_to_conv(c, what, WFLAG_SEND | (isauto ? WFLAG_AUTO : 0), NULL, time(NULL), -1); 838 gaim_conversation_write(c, NULL, what, -1,
838 serv_send_im(c->gc, nick, what, -1, isauto ? IM_FLAG_AWAY : 0); 839 (WFLAG_SEND | (isauto ? WFLAG_AUTO : 0)),
840 time(NULL));
841 serv_send_im(gc, nick, what, -1, isauto ? IM_FLAG_AWAY : 0);
839 XSRETURN(0); 842 XSRETURN(0);
840 } 843 }
841 844
842 845
843 846
844 XS (XS_GAIM_print_to_chat) 847 XS (XS_GAIM_print_to_chat)
845 { 848 {
846 struct gaim_connection *gc; 849 struct gaim_connection *gc;
847 int id; 850 int id;
848 char *what; 851 char *what;
849 struct conversation *b = NULL; 852 struct gaim_conversation *b = NULL;
850 GSList *bcs; 853 GSList *bcs;
851 unsigned int junk; 854 unsigned int junk;
852 dXSARGS; 855 dXSARGS;
853 items = 0; 856 items = 0;
854 857
860 XSRETURN(0); 863 XSRETURN(0);
861 return; 864 return;
862 } 865 }
863 bcs = gc->buddy_chats; 866 bcs = gc->buddy_chats;
864 while (bcs) { 867 while (bcs) {
865 b = (struct conversation *)bcs->data; 868 b = (struct gaim_conversation *)bcs->data;
866 if (b->id == id) 869
870 if (gaim_chat_get_id(gaim_conversation_get_chat_data(b)) == id)
867 break; 871 break;
868 bcs = bcs->next; 872 bcs = bcs->next;
869 b = NULL; 873 b = NULL;
870 } 874 }
871 if (b) 875 if (b)

mercurial