summaryrefslogtreecommitdiff
path: root/plugins/YARelay/src/main.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-01-21 19:55:46 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-01-21 19:55:46 +0000
commit53d05354369c59a0c084bf0e4c72b1f25702746c (patch)
treeb0e1a78a847ff79edd681ac111b6e28a26e1a1b8 /plugins/YARelay/src/main.cpp
parente80241cc3e2964c49abfd34ee1df8b9d900b1e8c (diff)
YARelay: Minor cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@11888 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/YARelay/src/main.cpp')
-rw-r--r--plugins/YARelay/src/main.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp
index 668b5adf65..8a7974b621 100644
--- a/plugins/YARelay/src/main.cpp
+++ b/plugins/YARelay/src/main.cpp
@@ -54,7 +54,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
/**
* Protocols àcknowledgement
*/
-int ProtoAck(WPARAM wparam,LPARAM lparam)
+int ProtoAck(WPARAM,LPARAM lparam)
{
ACKDATA *pAck = (ACKDATA *)lparam;
if (pAck->type != ACKTYPE_MESSAGE || pAck->result != ACKRESULT_SUCCESS)
@@ -112,6 +112,7 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent)
case ID_STATUS_DND: statMask = STATUS_DND ;break;
case ID_STATUS_FREECHAT: statMask = STATUS_FREECHAT ;break;
case ID_STATUS_INVISIBLE:statMask = STATUS_INVISIBLE;break;
+ default: return 0;
}
if ((iForwardOnStatus & statMask) == 0)
return 0;
@@ -238,10 +239,10 @@ extern "C" int __declspec(dllexport) Load()
iForwardOnStatus = db_get_dw(NULL, "yaRelay", "ForwardOnStatus", STATUS_OFFLINE | STATUS_AWAY | STATUS_NA);
- DBVARIANT dbv;
- if (!db_get_ts(NULL, "yaRelay", "ForwardTemplate", &dbv)){
- _tcsncpy(tszForwardTemplate, dbv.ptszVal, SIZEOF(tszForwardTemplate));
- db_free(&dbv);
+ TCHAR *szForwardTemplate = db_get_tsa(NULL, "yaRelay", "ForwardTemplate");
+ if (szForwardTemplate){
+ _tcsncpy(tszForwardTemplate, szForwardTemplate, SIZEOF(tszForwardTemplate));
+ mir_free(szForwardTemplate);
}
else _tcsncpy(tszForwardTemplate, _T("%u: %m"), MAXTEMPLATESIZE-1);