summaryrefslogtreecommitdiff
path: root/plugins/NewXstatusNotify
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-08-03 15:21:09 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-08-03 15:21:09 +0000
commit4d502922d6b01ecdf3bb5f062f7f8bac436dda3c (patch)
tree9ac73781125398dab280e65454764edac3eb0bb1 /plugins/NewXstatusNotify
parentff3d2c8826713221e388cb221e00c3b680339b2f (diff)
more fixes for per-protocol templates
git-svn-id: http://svn.miranda-ng.org/main/trunk@10047 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify')
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index 43f08a3293..dd8213ce45 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -711,32 +711,31 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
replaceStrT(smi.newstatusmsg, buff);
}
- TCHAR *str, protoname[MAX_PATH] = { 0 };
- char *szprotoname;
+ TCHAR *str;
+ char protoname[MAX_PATH];
PROTOACCOUNT *pa = ProtoGetAccount(szProto);
if (smi.compare == COMPARE_DEL) {
- mir_sntprintf(protoname, SIZEOF(protoname), _T("%s_TPopupSMsgRemoved"), pa->tszAccountName);
- szprotoname = mir_t2a(protoname);
+ mir_snprintf(protoname, SIZEOF(protoname), "%s_TPopupSMsgRemoved", pa->szModuleName);
DBVARIANT dbVar = { 0 };
- db_get_ts(NULL, MODULE, szprotoname, &dbVar);
- if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
- db_free(&dbVar);
+ if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGREMOVED);
}
- else str = GetStr(&smi, dbVar.ptszVal);
+ else {
+ str = GetStr(&smi, dbVar.ptszVal);
+ db_free(&dbVar);
+ }
}
else {
- mir_sntprintf(protoname, SIZEOF(protoname), _T("%s_TPopupSMsgChanged"), pa->tszAccountName);
- szprotoname = mir_t2a(protoname);
+ mir_snprintf(protoname, SIZEOF(protoname), "%s_TPopupSMsgChanged", pa->szModuleName);
DBVARIANT dbVar = { 0 };
- db_get_ts(NULL, MODULE, szprotoname, &dbVar);
- if (lstrcmp(dbVar.ptszVal, NULL) == 0) {
- db_free(&dbVar);
+ if (db_get_ts(NULL, MODULE, protoname, &dbVar)) {
str = GetStr(&smi, DEFAULT_POPUP_SMSGCHANGED);
}
- else str = GetStr(&smi, dbVar.ptszVal);
+ else {
+ str = GetStr(&smi, dbVar.ptszVal);
+ db_free(&dbVar);
+ }
}
- mir_free(szprotoname);
ShowChangePopup(hContact, szProto,
LoadSkinnedProtoIcon(szProto, db_get_w(hContact, szProto, "Status", ID_STATUS_ONLINE)),