aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/context/libkvicontext.cpp
diff options
context:
space:
mode:
authorGravatar wodim2019-04-01 15:01:02 +0200
committerGravatar GitHub2019-04-01 15:01:02 +0200
commit1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9 (patch)
tree94cfdd5000b6b0d6af1272e89f8b234fd8c484d4 /src/modules/context/libkvicontext.cpp
parentAdd support for Python 3 (diff)
parentuintUserListMinimumWidth: Reduce minimum due to account for certain combinati... (diff)
downloadKVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.tar.gz
KVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.tar.bz2
KVIrc-1e89e2da2e3740e55642c8ce44c573cd4bbe6ea9.zip
Merge branch 'master' into python3
Diffstat (limited to 'src/modules/context/libkvicontext.cpp')
-rw-r--r--src/modules/context/libkvicontext.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp
index 163e4e86b..11eaaf93c 100644
--- a/src/modules/context/libkvicontext.cpp
+++ b/src/modules/context/libkvicontext.cpp
@@ -51,16 +51,16 @@
KVSM_PARAMETERS_BEGIN(c) \
KVSM_PARAMETER("irc_context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) \
KVSM_PARAMETERS_END(c) \
- KviConsoleWindow * pConsole = NULL; \
+ KviConsoleWindow * pConsole = nullptr; \
if(c->parameterCount() > 0) \
pConsole = g_pApp->findConsole(iContextId); \
else \
pConsole = c->window()->console();
#define GET_CONNECTION_FROM_STANDARD_PARAMS \
- GET_CONSOLE_FROM_STANDARD_PARAMS \
- KviIrcConnection * pConnection = NULL; \
- if(pConsole) \
+ GET_CONSOLE_FROM_STANDARD_PARAMS \
+ KviIrcConnection * pConnection = nullptr; \
+ if(pConsole) \
pConnection = pConsole->context()->connection();
#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName, _setCall) \
@@ -655,7 +655,7 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c)
QString szQuery;
QString szType;
QString szParam1;
- bool bRemote = true;
+ bool bRemote;
KVSM_PARAMETERS_BEGIN(c)
KVSM_PARAMETER("query", KVS_PT_STRING, 0, szQuery)
@@ -689,16 +689,17 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c)
{
bRemote = false;
}
+ else if(szType.compare("remote") == 0 || szType.isEmpty())
+ {
+ bRemote = true;
+ }
else
{
- // already defaults to true, we only catch the error condition
- if(szType.compare("remote") != 0)
- {
- c->warning(__tr2qs("You specified a bad string for the parameter \"type\""));
- c->returnValue()->setString("");
- return true;
- }
+ c->warning(__tr2qs("You specified a bad string for the parameter \"type\""));
+ c->returnValue()->setString("");
+ return true;
}
+
//context is never null, connection can be null
if(!pConsole->context()->connection())
{