Exemplo n.º 1
0
char* html_to_bbcodes(char *src)
{
	int size = MultiByteToWideChar(codepage, 0, src, -1, 0, 0);
	wchar_t* buf=new wchar_t[size];
	MultiByteToWideChar(codepage, 0, src, -1, 0, 0);
	wchar_t* stripped_buf=html_to_bbcodes(buf);
	delete[] buf;
	size = WideCharToMultiByte( codepage, 0, stripped_buf, -1, 0, 0, NULL, NULL );
	char* dest=new char[size];
	WideCharToMultiByte( codepage, 0, stripped_buf, -1, dest, size, NULL, NULL );
	delete[] stripped_buf;
	return dest;
}
Exemplo n.º 2
0
int __cdecl CAimProto::RecvMsg(MCONTACT hContact, PROTORECVEVENT* pre)
{
	char *omsg = pre->szMessage;
	char *bbuf = NULL;
	if (getByte(AIM_KEY_FI, 1))
	{
		debugLogA("Converting from html to bbcodes then stripping leftover html.");
		pre->szMessage = bbuf = html_to_bbcodes(pre->szMessage);
	}
	debugLogA("Stripping html.");
	html_decode(pre->szMessage);

	INT_PTR res = Proto_RecvMessage(hContact, pre);
   mir_free(bbuf);
	pre->szMessage = omsg;
	return ( int )res;
}