diff options
| author | 2010-02-19 11:08:09 +0000 | |
|---|---|---|
| committer | 2010-02-19 11:08:09 +0000 | |
| commit | 128ac3dd722b24f161501ab6ab63e2f4dd89f7cf (patch) | |
| tree | 549527564cba05a0f4e011289d56194402fdeb73 /src/modules/context | |
| parent | fix for #724 (diff) | |
| download | KVIrc-128ac3dd722b24f161501ab6ab63e2f4dd89f7cf.tar.gz KVIrc-128ac3dd722b24f161501ab6ab63e2f4dd89f7cf.tar.bz2 KVIrc-128ac3dd722b24f161501ab6ab63e2f4dd89f7cf.zip | |
added a specialized serverinfo structure for ircd-seven;
added funzion $context.serverSoftware()
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@3989 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/context')
| -rw-r--r-- | src/modules/context/libkvicontext.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 5be368633..eae3af7d7 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -72,6 +72,22 @@ return true; \ } +#define STANDARD_SERVERINFO_TARGET_PARAMETER(_fncName,_setCall) \ + static bool _fncName(KviKvsModuleFunctionCall * c) \ + { \ + GET_CONNECTION_FROM_STANDARD_PARAMS \ + if(pConnection) \ + { \ + if(pConnection->serverInfo()) \ + { \ + _setCall; \ + return true; \ + } \ + } \ + c->returnValue()->setNothing(); \ + return true; \ + } + /* @doc: context.networkName @type: @@ -219,6 +235,36 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( ) /* + @doc: context.serverSoftware + @type: + function + @title: + $context.serverSoftware + @short: + Returns the software running on the irc server, if recognized + @syntax: + <string> $context.serverSoftware + <string> $context.serverSoftware(<irc_context_id:uint>) + @description: + Returns the software running on the irc server, if it has been + recognized at connection time. + If no irc_context_id is specified then the current irc_context is used. + If the irc_context_id specification is not valid then this function + returns nothing (that evaluates to false). If the specified IRC context + is not currently connected then this function returns nothing (that + evaluates to false). + @seealso: + [fnc]$context.serverPort[/fnc], + [fnc]$context.serverHostName[/fnc], + [fnc]$context.serverPassword[/fnc] +*/ + +STANDARD_SERVERINFO_TARGET_PARAMETER( + context_kvs_fnc_serverSoftware, + c->returnValue()->setString(pConnection->serverInfo()->software()) + ) + +/* @doc: context.serverPassword @type: function @@ -380,6 +426,7 @@ static bool context_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"networkName",context_kvs_fnc_networkName); KVSM_REGISTER_FUNCTION(m,"state",context_kvs_fnc_state); KVSM_REGISTER_FUNCTION(m,"list",context_kvs_fnc_list); + KVSM_REGISTER_FUNCTION(m,"serverSoftware",context_kvs_fnc_serverSoftware); return true; } |
