Exemplo n.º 1
0
int CAimProto::aim_request_avatar(HANDLE hServerConn, unsigned short &seqno, const char* sn, unsigned short bart_type, const char* hash, unsigned short hash_size)
{
    unsigned short offset = 0;
    unsigned char sn_length = (unsigned char)mir_strlen(sn);
    char* buf = (char*)alloca(SNAC_SIZE + sn_length + hash_size + 12);
    aim_writesnac(0x10, 0x06, offset, buf);
    aim_writechar(sn_length, offset, buf);                            // screen name length
    aim_writegeneric(sn_length, sn, offset, buf);                      // screen name
    aim_writechar(1, offset, buf);                                    // number of BART ID
    aim_writebartid(bart_type, 0, hash_size, hash, offset, buf);
    return aim_sendflap(hServerConn, 0x02, offset, buf, seqno);
}
Exemplo n.º 2
0
int CAimProto::aim_set_statusmsg(HANDLE hServerConn,unsigned short &seqno,const char *msg)//user info
{
	size_t msg_size =_strlens(msg);

	unsigned short msgoffset=0;
	char* msgbuf=(char*)alloca(10+msg_size);

	if (msg_size)
	{
		char* msgb=(char*)alloca(4+msg_size);
		msgb[0]=(unsigned char)(msg_size >> 8);
		msgb[1]=(unsigned char)(msg_size & 0xff);
		memcpy(&msgb[2],msg,msg_size);
		msgb[msg_size+2]=0;
		msgb[msg_size+3]=0;
		
		aim_writebartid(2,4,(unsigned short)(msg_size+4),msgb,msgoffset,msgbuf);
	}
	else