summaryrefslogtreecommitdiff
path: root/messages.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'messages.cpp')
-rwxr-xr-xmessages.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/messages.cpp b/messages.cpp
index c563e78..e64fd53 100755
--- a/messages.cpp
+++ b/messages.cpp
@@ -101,28 +101,28 @@ int RecvMsgSvc_func(HANDLE hContact, std::wstring str, char *msg, DWORD flags, D
{
char *inkeyid = UniGetContactSettingUtf(metaGetMostOnline(hContact), szGPGModuleName, "InKeyID", "");
TCHAR *pass = NULL;
- if(strlen(inkeyid) > 0)
+ if(inkeyid[0])
{
string dbsetting = "szKey_";
dbsetting += inkeyid;
dbsetting += "_Password";
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), _T(""));
- if(_tcslen(pass) > 0)
+ if(pass[0])
debuglog<<time_str()<<": info: found password in database for key id: "<<inkeyid<<", trying to decrypt message from "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" with password\n";
}
else
{
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T(""));
- if(_tcslen(pass) > 0)
+ if(pass[0])
debuglog<<time_str()<<": info: found password for all keys in database, trying to decrypt message from "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" with password\n";
}
- if(_tcslen(pass) > 0)
+ if(pass && pass[0])
{
cmd += _T("--passphrase \"");
cmd += pass;
cmd += _T("\" ");
}
- else if(password)
+ else if(password && password[0])
{
debuglog<<time_str()<<": info: found password in memory, trying to decrypt message from "<<(TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)<<" with password\n";
cmd += _T("--passphrase \"");