diff options
Diffstat (limited to 'plugins/SimpleAR/src/Main.cpp')
-rw-r--r-- | plugins/SimpleAR/src/Main.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 5b468ea34b..904cf42461 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -220,17 +220,16 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) mir_sntprintf(ptszTemp2, msgLen+5, _T("%s\r\n\r\n%s"), ptszTemp.c_str(), dbv.ptszVal);
if (ServiceExists(MS_VARS_FORMATSTRING))
{
- FORMATINFO fi;
-
- memset(&fi, 0, sizeof(fi));
+ FORMATINFO fi = { 0 };
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, 0, (LPARAM)pszUtf);
+ }
+ else ptszTemp = Utils_ReplaceVarsT(ptszTemp2);
+
+ T2Utf pszUtf(ptszTemp);
+ CallContactService(hContact, PSS_MESSAGE, 0, pszUtf);
dbei.cbSize = sizeof(dbei);
dbei.eventType = EVENTTYPE_MESSAGE;
@@ -242,7 +241,6 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent) db_event_add(hContact, &dbei);
mir_free(ptszTemp2);
- mir_free(pszUtf);
if (dbvNick.ptszVal)
db_free(&dbvNick);
if (dbvHead.ptszVal)
|