示例#1
0
EXPORT void libqq_getqunname( qqclient* qq, uint ext_id, char* buf )
{
	qqqun* q = qun_get_by_ext( qq, ext_id );
	if( q ){
		strncpy( buf, q->name, 15 );
	}else{
		if( ext_id != 0 ){
			sprintf( buf, "%u" , ext_id );
		}
	}
}
示例#2
0
文件: webqq.c 项目: PythonYXY/myqq3
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;
}
示例#3
0
EXPORT void libqq_getqunmembername( qqclient* qq, uint ext_id, uint uid, char* buf )
{
	qqqun* q = qun_get_by_ext( qq, ext_id );
	if( q ){
		qunmember* m = qun_member_get( qq, q, uid, 0 );
		if( m ){
			strncpy( buf, m->nickname, 15 );
			return;
		}
	}
	if( uid != 0 ){
		sprintf( buf, "%u" , uid );
	}
}
示例#4
0
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;
}