aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules
diff options
context:
space:
mode:
authorGravatar Szymon Tomasz Stefanek2011-03-24 04:33:50 +0000
committerGravatar Szymon Tomasz Stefanek2011-03-24 04:33:50 +0000
commit37d393e28cc12d56c3be0f854446068a154829ac (patch)
tree2cdbdd4146dd732dda3d635dbc59a9c02edce5ee /src/modules
parentRemove a highlighting popup warning (diff)
downloadKVIrc-37d393e28cc12d56c3be0f854446068a154829ac.tar.gz
KVIrc-37d393e28cc12d56c3be0f854446068a154829ac.tar.bz2
KVIrc-37d393e28cc12d56c3be0f854446068a154829ac.zip
Add .queueSize()
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5683 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/context/libkvicontext.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp
index e7ce372d7..c1eb06851 100644
--- a/src/modules/context/libkvicontext.cpp
+++ b/src/modules/context/libkvicontext.cpp
@@ -571,6 +571,34 @@ static bool context_kvs_cmd_clearQueue(KviKvsModuleCommandCall * c)
return true;
}
+/*
+ @doc: context.queueSize
+ @type:
+ function
+ @title:
+ $context.queueSize
+ @short:
+ Returns the size of the current server message queue
+ @syntax:
+ <integer> $context.queueSize
+ <integer> $context.queueSize(<irc_context_id:uint>)
+ @description:
+ Returns the number of messages currently in the server message queue.
+ 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 0.
+ @seealso:
+ [cmd]context.clearqueue[/cmd],
+*/
+
+static bool context_kvs_fnc_queueSize(KviKvsModuleFunctionCall * c)
+{
+ GET_CONNECTION_FROM_STANDARD_PARAMS;
+
+ c->returnValue()->setInteger(pConnection ? pConnection->outputQueueSize() : 0);
+
+ return true;
+}
static bool context_module_init(KviModule * m)
{
@@ -588,6 +616,7 @@ static bool context_module_init(KviModule * m)
KVSM_REGISTER_FUNCTION(m,"serverSoftware",context_kvs_fnc_serverSoftware);
KVSM_REGISTER_FUNCTION(m,"connectionStartTime",context_kvs_fnc_connectionStartTime);
KVSM_REGISTER_FUNCTION(m,"lastMessageTime",context_kvs_fnc_lastMessageTime);
+ KVSM_REGISTER_FUNCTION(m,"queueSize",context_kvs_fnc_queueSize);
KVSM_REGISTER_SIMPLE_COMMAND(m,"clearQueue",context_kvs_cmd_clearQueue);