| 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 { |
| 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 |