40
40
#include "KviKvsEventManager.h"
41
41
#include "KviKvsEventHandler.h"
42
42
#include "KviLagMeter.h"
43
#include "KviIrcUserEntry.h"
46
46
namespace KviKvsCoreFunctions
49
/////////////////////////////////////////////////////////////////////////////////////////
58
Returns the gender of the specified user
60
<string> $gender(<nickname:string>)
62
Returns the gender, or 'unknown' if not setted from remote user, of the specified IRC user IF it is known.[br]
63
The gender is known if [fnc]$isWellKnown[/fnc] returns 1.[br]
64
The gender is generally known if the user is on a channel with you
65
or has an open query with you.[br]
66
Detailed explaination:[br]
67
KVIrc has an internal database of users that are currently
68
visible by *this client*: this includes users on open channels
69
and queries.[br] The other IRC users are NOT in the database:
70
this means that KVIrc knows NOTHING about them and can't return
71
any information immediately. In this case this function will return
73
If a user is in the database, at least his nickname is known.[br]
74
The username and hostname are known only if the server provides that information
75
spontaneously or after a KVIrc request.[br]
76
KVIrc requests user information for all the users in open queries
77
and channels. This information takes some time to be retrieved,
78
in this interval of time KVIrc knows only the user's nickname.
79
This function will return the string "*" in this case.[br]
81
[fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$realname[/fnc], [cmd]$username[/cmd]
88
KVSCF_PARAMETERS_BEGIN
89
KVSCF_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick)
92
if(KVSCF_pContext->window()->console())
94
if(KVSCF_pContext->window()->console()->isConnected())
96
KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick);
100
if(e->gender()==KviIrcUserEntry::Male) szGender = "male";
101
else if(e->gender()==KviIrcUserEntry::Female) szGender = "female";
102
else szGender = "unknown";
103
KVSCF_pRetBuffer->setString(szGender);
109
KVSCF_pRetBuffer->setNothing();
48
112
///////////////////////////////////////////////////////////////////////////////////////////////
267
331
<float> $hptimestamp
269
333
Returns a high precision timestamp as a floaint point value.
270
The timestamp rappresent the number of seconds elapsed since
334
The timestamp represents the number of seconds elapsed since
271
335
a certain moment in the past. The number of seconds
272
336
contains a "high precision" fractional part. The "certain moment" definition
273
337
depends on the platform KVIrc is executed. This means that
274
this timestamp is totally useless to rappresent a time value
338
this timestamp is totally useless to represent a time value
275
339
but is useful to compute time intervals with sub-second precision.
512
/////////////////////////////////////////////////////////////////////////////////////////
521
Returns 1 if the user is a bot. Otherwise return 0.
523
<string> $isbot(<nickname:string>)
525
Returns 1 if the user is a bot. Otherwise return 0.[br]
526
This info is known if [fnc]$isWellKnown[/fnc] returns 1.[br]
527
This info is generally known if the user is on a channel with you
528
or has an open query with you.[br]
529
Detailed explaination:[br]
530
KVIrc has an internal database of users that are currently
531
visible by *this client*: this includes users on open channels
532
and queries.[br] The other IRC users are NOT in the database:
533
this means that KVIrc knows NOTHING about them and can't return
534
any information immediately. In this case this function will return
536
If a user is in the database, at least his nickname is known.[br]
537
The username and hostname are known only if the server provides that information
538
spontaneously or after a KVIrc request.[br]
539
KVIrc requests user information for all the users in open queries
540
and channels. This information takes some time to be retrieved,
541
in this interval of time KVIrc knows only the user's nickname.
542
This function will return the string "*" in this case.[br]
544
[fnc]$isWellKnown[/fnc], [fnc]$hostname[/fnc], [fnc]$realname[/fnc], [cmd]$username[/cmd]
551
KVSCF_PARAMETERS_BEGIN
552
KVSCF_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick)
555
if(KVSCF_pContext->window()->console())
557
if(KVSCF_pContext->window()->console()->isConnected())
559
KviIrcUserEntry * e = KVSCF_pContext->window()->connection()->userDataBase()->find(szNick);
562
KVSCF_pRetBuffer->setBoolean(e->isBot());
567
KVSCF_pRetBuffer->setNothing();
448
570
///////////////////////////////////////////////////////////////////////////////////////////////
662
784
<boolean> $istimer(<name:string>)
664
Returns 1 if the timer named <name> is actually running, else 0
786
Returns 1 if the timer named <name> is actually running, 0 otherwise.
666
788
[cmd]timer[/cmd], [cmd]killtimer[/cmd]
822
944
<string> $lang([<type:string>])
824
Returns the short name of currently used language
946
Returns the short name of currently used language.[br]
825
947
Type <type> should be one of: [br]
826
"full" - returns full locale name, such as ru_RU.UTF-8 (default)
827
"lang" - return language name, such as "ru_RU"
828
"short" - returns only language group such as "ru"
948
"full" - returns full locale name, such as ru_RU.UTF-8 (default).[br]
949
"lang" - return language name, such as "ru_RU".[br]
950
"short" - returns only language group such as "ru".[br]
1010
1132
QString szText, szFlags;
1011
1133
KVSCF_PARAMETERS_BEGIN
1012
1134
KVSCF_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL,szText)
1013
KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags)
1135
KVSCF_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags)
1014
1136
KVSCF_PARAMETERS_END
1016
1138
bool bCaseSensitive = szFlags.indexOf('s',0,Qt::CaseInsensitive) != -1;