summaryrefslogtreecommitdiff
path: root/MirOTR/svcs_proto.cpp
diff options
context:
space:
mode:
authoradmin@progandy.co.cc <admin@progandy.co.cc@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-09-13 18:11:13 +0000
committeradmin@progandy.co.cc <admin@progandy.co.cc@eced67a3-f377-a0ae-92ae-d6de1850b05a>2010-09-13 18:11:13 +0000
commit376594ac1d65cbb31165f5a74775d624c3fd2981 (patch)
treeb1f9bf2ee2f1a82c5d9378c03cf09f72535c001d /MirOTR/svcs_proto.cpp
parent99ef7f1cfcaa4ead4b860faec88754abbe31ebfc (diff)
- added basic html conversion for receiving (maybe a bit too powerful)
- some bugfixes git-svn-id: http://mirotr.googlecode.com/svn/trunk@12 eced67a3-f377-a0ae-92ae-d6de1850b05a
Diffstat (limited to 'MirOTR/svcs_proto.cpp')
-rw-r--r--MirOTR/svcs_proto.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/MirOTR/svcs_proto.cpp b/MirOTR/svcs_proto.cpp
index 6e78a23..a679658 100644
--- a/MirOTR/svcs_proto.cpp
+++ b/MirOTR/svcs_proto.cpp
@@ -1,5 +1,6 @@
#include "stdafx.h"
#include "svcs_proto.h"
+#include "striphtml.h"
//TODO: Social-Millionaire-Dialoge
int SVC_OTRSendMessage(WPARAM wParam,LPARAM lParam){
@@ -319,12 +320,21 @@ int SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam){
if (context) {
TrustLevel level = otr_context_get_trust(context);
if (options.prefix_messages && (level == TRUST_PRIVATE || level == TRUST_UNVERIFIED)) {
+ char* premsg;
+ if (db_byte_get(ccs->hContact, MODULENAME, "HTMLConv", 0)) {
+ premsg = striphtml(newmessage);
+ otrl_message_free(newmessage);
+ newmessage = premsg;
+ is_miralloc = true;
+ }
+
+
DWORD len = (strlen(options.prefix)+strlen(newmessage)+1)*sizeof(char);
- char* premsg = (char*)mir_alloc( len );
+ premsg = (char*)mir_alloc( len );
memset(premsg, 0, len);
strcpy(premsg, options.prefix);
strcat(premsg, newmessage);
- otrl_message_free(newmessage);
+ (is_miralloc) ? mir_free(newmessage) : otrl_message_free(newmessage);
newmessage = premsg;
is_miralloc = true;
}