EXPORT int webqq_send_msg( user* u, uint to, char* buf, char qun_msg ) { if( qun_msg ){ qqqun* q = qun_get_by_ext( u->qq, to ); if( q ) return qun_send_message( u->qq, q->number, buf ); }else{ return buddy_send_message( u->qq, to, buf ); } return -1; }
EXPORT int libqq_sendmessage( qqclient* qq, uint to, char* buf, char qun_msg ) { char* tmp; int len = strlen(buf); if( len<1 ) return -2; NEW( tmp, len*2 ); gb_to_utf8( buf, tmp, len*2-1 ); if( qun_msg ){ qqqun* q = qun_get_by_ext( qq, to ); if( q ) qun_send_message( qq, q->number, tmp ); }else{ buddy_send_message( qq, to, tmp ); } DEL( tmp ); return 0; }