diff options
| author | 2010-12-16 04:54:16 +0000 | |
|---|---|---|
| committer | 2010-12-16 04:54:16 +0000 | |
| commit | 0e5af25ef8687d5029b0acaaa620d9e99a993bae (patch) | |
| tree | ae5a32e2ce9e411e984431dfa082f2a335702c50 /src/modules/context | |
| parent | table object: fixed indentation, added proper doc for $sizeHintCellRequestEve... (diff) | |
| download | KVIrc-0e5af25ef8687d5029b0acaaa620d9e99a993bae.tar.gz KVIrc-0e5af25ef8687d5029b0acaaa620d9e99a993bae.tar.bz2 KVIrc-0e5af25ef8687d5029b0acaaa620d9e99a993bae.zip | |
Added context.clearQueue
git-svn-id: https://svn.kvirc.de/svn/trunk/kvirc@5191 17fca916-40b9-46aa-a4ea-0a15b648b75c
Diffstat (limited to 'src/modules/context')
| -rw-r--r-- | src/modules/context/libkvicontext.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 10ec9e208..bfa9f373c 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -415,6 +415,42 @@ static bool context_kvs_fnc_list(KviKvsModuleFunctionCall * c) return true; } + +/* + @doc: context.clearqueue + @type: + command + @title: + context.clearqueue + @syntax: + context.clearqueue [-a] + @switches: + !sw: -a | --all + Remove ALL messages, not just the private messages. + @short: + Removes messages from the socked output queue. + @description: + Removes the PRIVMSG messages from the socket output queue. + This can be used to save yourself in-extremis if you have pasted a huge amount of text + but otherwise you shouldn't need it. Do not use in scripts. + Be aware that the -a switch MAY CONFUSE KVIRC quite a bit: do not use it unless + you REALLY know what you're doing. +*/ +static bool context_kvs_cmd_clearQueue(KviKvsModuleCommandCall * c) +{ + QString szTarget; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) + KVSM_PARAMETERS_END(c) + + KVSM_REQUIRE_CONNECTION(c) + + c->window()->connection()->clearOutputQueue(!c->switches()->find('a',"all")); + + return true; +} + + static bool context_module_init(KviModule * m) { KVSM_REGISTER_FUNCTION(m,"serverHostName",context_kvs_fnc_serverHostName); @@ -428,6 +464,8 @@ static bool context_module_init(KviModule * m) KVSM_REGISTER_FUNCTION(m,"list",context_kvs_fnc_list); KVSM_REGISTER_FUNCTION(m,"serverSoftware",context_kvs_fnc_serverSoftware); + KVSM_REGISTER_SIMPLE_COMMAND(m,"clearQueue",context_kvs_cmd_clearQueue); + return true; } |
