summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2012-03-02 15:58:41 +0000
committermataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2012-03-02 15:58:41 +0000
commit8957adebca8d37af94aa9ffb7baebba9980c3f30 (patch)
tree0dbd5a194313be5d6987462c017d59885e51d3a6
parent64d4b3de496e5bb57c907e95cce03e1862173c0f (diff)
SimpleAR:
use variables plugin if installed git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@274 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
-rw-r--r--SimpleAR/Src/Main.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/SimpleAR/Src/Main.cpp b/SimpleAR/Src/Main.cpp
index 4afdab7..1705ce2 100644
--- a/SimpleAR/Src/Main.cpp
+++ b/SimpleAR/Src/Main.cpp
@@ -268,7 +268,17 @@ INT addEvent(WPARAM wParam, LPARAM lParam)
}
ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen+5));
mir_sntprintf(ptszTemp2, msgLen+5, _T("%s\r\n\r\n%s"), ptszTemp, dbv.ptszVal);
- ptszTemp = Utils_ReplaceVarsT(ptszTemp2);
+ if (ServiceExists(MS_VARS_FORMATSTRING))
+ {
+ FORMATINFO fi;
+
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.flags = FIF_TCHAR;
+ fi.tszFormat = ptszTemp2;
+ ptszTemp = (TCHAR*)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ }else
+ ptszTemp = Utils_ReplaceVarsT(ptszTemp2);
char* pszUtf = mir_utf8encodeT(ptszTemp);
CallContactService(hContact, PSS_MESSAGE, PREF_UTF, (LPARAM)pszUtf);
@@ -281,7 +291,10 @@ INT addEvent(WPARAM wParam, LPARAM lParam)
dbei.pBlob = (PBYTE)pszUtf;
CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
- mir_free(ptszTemp);
+ if (ServiceExists(MS_VARS_FORMATSTRING))
+ CallService(MS_VARS_FREEMEMORY, (WPARAM)ptszTemp, 0);
+ else
+ mir_free(ptszTemp);
mir_free(ptszTemp2);
mir_free(pszUtf);
if (dbvNick.ptszVal)