@ -68,7 +68,7 @@ KviRegisteredUsersDialog * g_pRegisteredUsersDialog = 0;
The reguser module is the scripting interface to the [ doc : registered_users ] registered users database [ / doc ] . [ br ]
It provides the following set of commands : [ br ]
[ cmd ] reguser . add [ / cmd ] : adds an user entry to the database [ br ]
[ cmd ] reguser . add tq mask[ / cmd ] : adds an user ' s tq mask to the database [ br ]
[ cmd ] reguser . add mask[ / cmd ] : adds an user ' s mask to the database [ br ]
[ cmd ] reguser . remove [ / cmd ] : removes an user entry from the database [ br ]
[ fnc ] $ reguser . list [ / fnc ] : lists the entries [ br ]
[ cmd ] reguser . setproperty [ / cmd ] : sets a property associated to an entry [ br ]
@ -77,7 +77,7 @@ KviRegisteredUsersDialog * g_pRegisteredUsersDialog = 0;
[ fnc ] $ reguser . exactMatch [ / fnc ] ( ) : finds an entry by comparing masks [ br ]
[ fnc ] $ reguser . property [ / fnc ] ( ) : finds a property associated to an entry [ br ]
[ fnc ] $ reguser . matchProperty [ / fnc ] ( ) : shortcut for [ fnc ] $ reguser . property [ / fnc ] ( [ fnc ] $ reguser . match [ / fnc ] ( ) ) [ br ]
[ fnc ] $ reguser . tq mask[ / fnc ] ( ) : returns the registration masks for an entry
[ fnc ] $ reguser . mask[ / fnc ] ( ) : returns the registration masks for an entry
*/
/*
@ -105,7 +105,7 @@ KviRegisteredUsersDialog * g_pRegisteredUsersDialog = 0;
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ]
*/
@ -115,12 +115,12 @@ static bool reguser_kvs_cmd_edit(KviKvsModuleCommandCall * c)
{
if ( c - > hasSwitch ( ' t ' , " toplevel " ) )
{
if ( g_pRegisteredUsersDialog - > tq parent( ) )
if ( g_pRegisteredUsersDialog - > parent( ) )
{
g_pRegisteredUsersDialog - > reparent ( 0 , TQPoint ( 0 , 0 ) , true ) ;
}
} else {
if ( TQT_BASE_OBJECT ( g_pRegisteredUsersDialog - > tq parent( ) ) ! = TQT_BASE_OBJECT ( c - > window ( ) - > frame ( ) - > splitter ( ) ) )
if ( TQT_BASE_OBJECT ( g_pRegisteredUsersDialog - > parent( ) ) ! = TQT_BASE_OBJECT ( c - > window ( ) - > frame ( ) - > splitter ( ) ) )
{
g_pRegisteredUsersDialog - > reparent ( c - > window ( ) - > frame ( ) - > splitter ( ) , TQPoint ( 0 , 0 ) , true ) ;
}
@ -150,19 +150,19 @@ static bool reguser_kvs_cmd_edit(KviKvsModuleCommandCall * c)
@ short :
Registers an user
@ syntax :
reguser . add [ - r ] [ - f ] [ - q ] [ - g = group ] < name > [ tq mask]
reguser . add [ - r ] [ - f ] [ - q ] [ - g = group ] < name > [ mask]
@ description :
Adds a new entry with the specified < name > to the database . [ br ]
If the database contains an entry with the same < name > , this command just prints
a warning and returns . [ br ]
If no [ tq mask] is given the new entry has no registration masks : so it can ' t be " matched " yet . You have to add
at least one tq mask with [ cmd ] reguser . add tq mask[ / cmd ] .
If [ tq mask] is given , then it is added to the entry tq mask list . [ br ]
If no [ mask] is given the new entry has no registration masks : so it can ' t be " matched " yet . You have to add
at least one mask with [ cmd ] reguser . add mask[ / cmd ] .
If [ mask] is given , then it is added to the entry mask list . [ br ]
The < name > parameter may contain any character : even spaces are allowed ( obviously you have to
use quotes in that case ) . [ br ]
If the ' - r ' switch is given , the new entry replaces any previous one with the same < name > ( the old entry is removed ) . [ br ]
If the ' - f ' switch is given , and there is an existing entry with the same name , no warning is printed
and the old entry is treated just like it has been just added ( thus the [ tq mask] is eventually added to its tq mask list ) . [ br ]
and the old entry is treated just like it has been just added ( thus the [ mask] is eventually added to its mask list ) . [ br ]
The ' - q ' switch causes the command to run in " quiet " mode and print no warning . [ br ]
@ examples :
[ example ]
@ -172,7 +172,7 @@ static bool reguser_kvs_cmd_edit(KviKvsModuleCommandCall * c)
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ]
*/
@ -182,7 +182,7 @@ static bool reguser_kvs_cmd_add(KviKvsModuleCommandCall * c)
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " name " , KVS_PT_STRING , 0 , szName )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETERS_END ( c )
if ( szName . isEmpty ( ) )
{
@ -253,7 +253,7 @@ static bool reguser_kvs_cmd_add(KviKvsModuleCommandCall * c)
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ]
*/
@ -280,51 +280,51 @@ static bool reguser_kvs_cmd_remove(KviKvsModuleCommandCall * c)
}
/*
@ doc : reguser . add tq mask
@ doc : reguser . add mask
@ type :
command
@ title :
reguser . add tq mask
reguser . add mask
@ keyterms :
registering users
@ short :
Adds a tq mask to a registered user
Adds a mask to a registered user
@ syntax :
reguser . add tq mask [ - f ] < name > < tq mask>
reguser . add mask [ - f ] < name > < mask>
@ description :
Adds a registration tq mask to the database entry with name < name > . [ br ]
The < tq mask> has the common [ doc : irc_masks ] irc tq mask[ / doc ] format . [ br ]
The only restriction on the < tq mask> is that it must be unique inside the
regusers database : you can ' t match two users with the same tq mask ( it would
Adds a registration mask to the database entry with name < name > . [ br ]
The < mask> has the common [ doc : irc_masks ] irc mask[ / doc ] format . [ br ]
The only restriction on the < mask> is that it must be unique inside the
regusers database : you can ' t match two users with the same mask ( it would
have rather undefined results ) . [ br ]
If - f is used , KVIrc ensures that the tq mask is unique in the database
If - f is used , KVIrc ensures that the mask is unique in the database
and associates is to THIS registered user ( breaking the previous associations ) . < br >
Once at least one tq mask has been added , the user can be " matched "
Once at least one mask has been added , the user can be " matched "
by using the [ fnc ] $ reguser . match [ / fnc ] ( ) function . [ br ]
Each database entry can have an unlimited number of masks . [ br ]
@ examples :
[ example ]
[ cmd ] reguser . add [ / cmd ] " Szymon Stefanek "
reguser . add tq mask " Szymon Stefanek " Pragma ! * @ * . it
reguser . add mask " Szymon Stefanek " Pragma ! * @ * . it
[ / example ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . del tq mask[ / cmd ] ,
[ cmd ] reguser . del mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . exactMatch [ / fnc ]
*/
static bool reguser_kvs_cmd_add tq mask( KviKvsModuleCommandCall * c )
static bool reguser_kvs_cmd_add mask( KviKvsModuleCommandCall * c )
{
TQString szName ;
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " name " , KVS_PT_STRING , 0 , szName )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETERS_END ( c )
if ( szName . isEmpty ( ) )
@ -335,7 +335,7 @@ static bool reguser_kvs_cmd_addtqmask(KviKvsModuleCommandCall * c)
if ( szMask . isEmpty ( ) )
{
c - > warning ( __tr2qs ( " No tq mask specified" ) ) ;
c - > warning ( __tr2qs ( " No mask specified" ) ) ;
return true ;
}
@ -357,27 +357,27 @@ static bool reguser_kvs_cmd_addtqmask(KviKvsModuleCommandCall * c)
}
/*
@ doc : reguser . del tq mask
@ doc : reguser . del mask
@ type :
command
@ title :
reguser . del tq mask
reguser . del mask
@ keyterms :
registering users
@ short :
Removes a tq mask from the regusers database
Removes a mask from the regusers database
@ syntax :
reguser . del tq mask < tq mask>
reguser . del mask < mask>
@ description :
Removes a tq mask from the regusers database . [ br ]
Removes a mask from the regusers database . [ br ]
Since masks are unique in the database , you don ' t need to pass
an < user > parameter : if an < user > entry has the < tq mask> , removing that < tq mask>
an < user > parameter : if an < user > entry has the < mask> , removing that < mask>
will surely remove it from that < user > entry . ( contorsions ? ) [ br ]
@ examples :
[ example ]
[ cmd ] reguser . add [ / cmd ] " Szymon Stefanek "
[ cmd ] reguser . add tq mask[ / cmd ] " Szymon Stefanek " Pragma ! * @ * . it
reguser . del tq mask Pragma ! * @ * . it
[ cmd ] reguser . add mask[ / cmd ] " Szymon Stefanek " Pragma ! * @ * . it
reguser . del mask Pragma ! * @ * . it
[ fnc ] $ reguser . list [ / fnc ]
[ / example ]
@ seealso :
@ -385,22 +385,22 @@ static bool reguser_kvs_cmd_addtqmask(KviKvsModuleCommandCall * c)
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . exactMatch [ / fnc ]
*/
static bool reguser_kvs_cmd_del tq mask( KviKvsModuleCommandCall * c )
static bool reguser_kvs_cmd_del mask( KviKvsModuleCommandCall * c )
{
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETERS_END ( c )
if ( szMask . isEmpty ( ) )
{
c - > warning ( __tr2qs ( " No tq mask specified" ) ) ;
c - > warning ( __tr2qs ( " No mask specified" ) ) ;
return true ;
}
@ -564,8 +564,8 @@ static bool reguser_kvs_cmd_setIgnoreFlags(KviKvsModuleCommandCall * c)
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . del tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ cmd ] reguser . del mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . matchProperty [ / fnc ]
@ -619,8 +619,8 @@ static bool reguser_kvs_fnc_getIgnoreFlags(KviKvsModuleFunctionCall * c)
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . del tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ cmd ] reguser . del mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . matchProperty [ / fnc ]
@ -685,7 +685,7 @@ static bool reguser_kvs_cmd_setproperty(KviKvsModuleCommandCall * c)
TQString szProperty ;
TQString szValue ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , 0 , szName )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , 0 , szName )
KVSM_PARAMETER ( " property " , KVS_PT_STRING , 0 , szProperty )
KVSM_PARAMETER ( " value " , KVS_PT_STRING , KVS_PF_OPTIONAL , szValue )
KVSM_PARAMETERS_END ( c )
@ -722,19 +722,19 @@ static bool reguser_kvs_cmd_setproperty(KviKvsModuleCommandCall * c)
@ short :
Get a list of registered user masks
@ syntax :
$ reguser . list ( [ tq mask] )
$ reguser . list ( [ mask] )
@ description :
Returns an array of the entries in the registered users database . [ br ]
If < tq mask> is specified , only entries matching the < tq mask>
If < mask> is specified , only entries matching the < mask>
and the entries with no registration masks are listed . [ br ]
Please note that < tq mask> is a wildcard string that will match
Please note that < mask> is a wildcard string that will match
wildcard strings . . . don ' t get messed with that : D [ br ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . exactMatch [ / fnc ]
*/
@ -744,10 +744,10 @@ static bool reguser_kvs_fnc_list(KviKvsModuleFunctionCall * c)
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " user_ tq mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETER ( " user_ mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETERS_END ( c )
KviIrcMask tq mask( szMask ) ;
KviIrcMask mask( szMask ) ;
KviKvsArray * pArray = new KviKvsArray ( ) ;
int aid = 0 ;
@ -759,7 +759,7 @@ static bool reguser_kvs_fnc_list(KviKvsModuleFunctionCall * c)
while ( KviRegisteredUser * u = it . current ( ) )
{
KviPointerList < KviIrcMask > * ml = u - > maskList ( ) ;
if ( u - > matches ( tq mask) | | ( ml - > count ( ) = = 0 ) )
if ( u - > matches ( mask) | | ( ml - > count ( ) = = 0 ) )
{
pArray - > set ( aid , new KviKvsVariant ( u - > name ( ) ) ) ;
aid + + ;
@ -781,12 +781,12 @@ static bool reguser_kvs_fnc_list(KviKvsModuleFunctionCall * c)
@ short :
Lists the registered users
@ syntax :
reguser . showlist [ tq mask]
reguser . showlist [ mask]
@ description :
Lists the entries in the registered users database . [ br ]
If < tq mask> is specified , only entries matching the < tq mask>
If < mask> is specified , only entries matching the < mask>
and the entries with no registration masks are listed . [ br ]
Please note that < tq mask> is a wildcard string that will match
Please note that < mask> is a wildcard string that will match
wildcard strings . . . don ' t get messed with that : D [ br ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
@ -801,10 +801,10 @@ static bool reguser_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
{
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETERS_END ( c )
KviIrcMask tq mask( szMask ) ;
KviIrcMask mask( szMask ) ;
c - > window ( ) - > outputNoFmt ( KVI_OUT_SYSTEMMESSAGE , __tr2qs ( " Registered users database dump: " ) ) ;
int count = 0 ;
@ -814,7 +814,7 @@ static bool reguser_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
while ( KviRegisteredUser * u = it . current ( ) )
{
KviPointerList < KviIrcMask > * ml = u - > maskList ( ) ;
if ( u - > matches ( tq mask) | | ( ml - > count ( ) = = 0 ) )
if ( u - > matches ( mask) | | ( ml - > count ( ) = = 0 ) )
{
c - > window ( ) - > output ( KVI_OUT_SYSTEMMESSAGE , __tr2qs ( " User: %c%Q " ) , KVI_TEXT_BOLD , & ( u - > name ( ) ) ) ;
@ -859,16 +859,16 @@ static bool reguser_kvs_cmd_showlist(KviKvsModuleCommandCall * c)
@ short :
Returns an entry in the registered user database
@ syntax :
$ reguser . match ( < user_ tq mask> )
$ reguser . match ( < user_ mask> )
@ description :
Returns the name of the first entry matching < user_ tq mask> in the registered user database . [ br ]
The < user_ tq mask> has the common [ doc : irc_masks ] irc tq mask[ / doc ] format but can ' t contain wildcards . [ br ]
Returns the name of the first entry matching < user_ mask> in the registered user database . [ br ]
The < user_ mask> has the common [ doc : irc_masks ] irc mask[ / doc ] format but can ' t contain wildcards . [ br ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . exactMatch [ / fnc ]
*/
@ -878,11 +878,11 @@ static bool reguser_kvs_fnc_match(KviKvsModuleFunctionCall * c)
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " user_ tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " user_ mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETERS_END ( c )
KviIrcMask tq mask( szMask ) ;
//FIXME: it crashes kvirc KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser( tq mask.nick(),tq mask.user(),tq mask.host());
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findMatchingUser ( tq mask. nick ( ) , tq mask. user ( ) , tq mask. host ( ) ) ;
KviIrcMask mask( szMask ) ;
//FIXME: it crashes kvirc KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser( mask.nick(),mask.user(),mask.host());
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findMatchingUser ( mask. nick ( ) , mask. user ( ) , mask. host ( ) ) ;
if ( u ) c - > returnValue ( ) - > setString ( u - > name ( ) ) ;
return true ;
}
@ -896,16 +896,16 @@ static bool reguser_kvs_fnc_match(KviKvsModuleFunctionCall * c)
@ short :
Returns an entry in the registered user database
@ syntax :
$ reguser . exactMatch ( < user_ tq mask> )
$ reguser . exactMatch ( < user_ mask> )
@ description :
Returns the name of the registered user database entry that has < user_ tq mask> in its registration tq mask list . [ br ]
The < user_ tq mask> has the common [ doc : irc_masks ] wild irc tq mask[ / doc ] format and can contain wildcards . [ br ]
Returns the name of the registered user database entry that has < user_ mask> in its registration mask list . [ br ]
The < user_ mask> has the common [ doc : irc_masks ] wild irc mask[ / doc ] format and can contain wildcards . [ br ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ]
*/
@ -915,10 +915,10 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c)
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " user_ tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " user_ mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETERS_END ( c )
KviIrcMask tq mask( szMask ) ;
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findUserWithMask ( tq mask) ;
KviIrcMask mask( szMask ) ;
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findUserWithMask ( mask) ;
if ( u ) c - > returnValue ( ) - > setString ( u - > name ( ) ) ;
return true ;
}
@ -932,24 +932,24 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c)
// @short:
// Returns entries in the registered user database
// @syntax:
// $reguser.matches(<user_ tq mask>)
// $reguser.matches(<user_ mask>)
// @description:
// Returns a comma separated list of registered user masks that match <user_ tq mask>.[br]
// User tq mask must be in the format <nick>!<user>@<host> , where <user> and
// Returns a comma separated list of registered user masks that match <user_ mask>.[br]
// User mask must be in the format <nick>!<user>@<host> , where <user> and
// <host> may contain '*' wildcards.[br]
// If no registered tq mask matches the <user_tq mask> an empty string is returned.[br]
// If no registered mask matches the <user_mask> an empty string is returned.[br]
// @seealso:
// [module:reguser]reguser module documentation[/module]
//*/
//static void search_reguser_list(KviRegisteredUserList * l,KviWindow * w,const char * tq mask,KviStr & buffer)
//static void search_reguser_list(KviRegisteredUserList * l,KviWindow * w,const char * mask,KviStr & buffer)
//{
// for(KviRegisteredUser * u = l->first();u;u = l->next())
// {
// if(u->matches( tq mask))
// if(u->matches( mask))
// {
// if(buffer.hasData())buffer.append(',');
// buffer.append(u-> tq mask());
// buffer.append(u-> mask());
// }
// }
//}
@ -977,17 +977,17 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c)
/*
@ doc : reguser . tq mask
@ doc : reguser . mask
@ type :
function
@ title :
$ reguser . tq mask
$ reguser . mask
@ short :
Returns the registration masks for a db entry
@ syntax :
$ reguser . tq mask( < name > [ , < N > ] )
$ reguser . mask( < name > [ , < N > ] )
@ description :
Returns the < N > th registration tq mask for the registered user database record identified
Returns the < N > th registration mask for the registered user database record identified
by < name > . If < N > is not given , returns an array of registration masks for that entry . [ br ]
If < name > does not identify a valid entry an empty string is returned ;
if < N > is out of range ( or there are no masks at all ) , an empty string is returned . [ br ]
@ -995,22 +995,22 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c)
@ examples :
[ example ]
[ cmd ] reguser . add [ / cmd ] Pragma
[ cmd ] reguser . add tq mask[ / cmd ] Pragma Pragma ! * @ * . it
[ cmd ] echo [ / cmd ] $ reguser . tq mask( Pragma , 0 )
[ cmd ] reguser . add mask[ / cmd ] Pragma Pragma ! * @ * . it
[ cmd ] echo [ / cmd ] $ reguser . mask( Pragma , 0 )
[ / example ]
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . del tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ cmd ] reguser . del mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . matchProperty [ / fnc ]
*/
static bool reguser_kvs_fnc_ tq mask( KviKvsModuleFunctionCall * c )
static bool reguser_kvs_fnc_ mask( KviKvsModuleFunctionCall * c )
{
TQString szName ;
TQString szN ;
@ -1058,7 +1058,7 @@ static bool reguser_kvs_fnc_tqmask(KviKvsModuleFunctionCall * c)
@ examples :
[ example ]
[ cmd ] reguser . add [ / cmd ] Pragma
[ cmd ] reguser . add tq mask[ / cmd ] Pragma Pragma ! * @ * . it
[ cmd ] reguser . add mask[ / cmd ] Pragma Pragma ! * @ * . it
[ cmd ] reguser . setproperty [ / cmd ] Pragma isDev 1
[ cmd ] echo [ / cmd ] $ reguser . property ( Pragma , isDev )
[ / example ]
@ -1067,7 +1067,7 @@ static bool reguser_kvs_fnc_tqmask(KviKvsModuleFunctionCall * c)
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . matchProperty [ / fnc ]
@ -1100,19 +1100,19 @@ static bool reguser_kvs_fnc_property(KviKvsModuleFunctionCall * c)
@ short :
Returns a property of an entry in the registered user database
@ syntax :
$ reguser . matchProperty ( < user_ tq mask> , < property_name > )
$ reguser . matchProperty ( < user_ mask> , < property_name > )
@ description :
Returns the value of the property identified by < property_name > and
bound to the first entry matched by by < user_ tq mask> . [ br ]
bound to the first entry matched by by < user_ mask> . [ br ]
If the property is not set , an empty string is returned . [ br ]
If no entry matches < user_ tq mask> this function returns an empty string
If no entry matches < user_ mask> this function returns an empty string
and does not print any error . [ br ]
[ example ]
% property = $ reguser . matchProperty ( < user_ tq mask> , < property_name > )
% property = $ reguser . matchProperty ( < user_ mask> , < property_name > )
[ / example ]
Is actually a shortcut for : [ br ]
[ example ]
% tmp = [ fnc ] $ reguser . match [ / fnc ] ( < user_ tq mask> )
% tmp = [ fnc ] $ reguser . match [ / fnc ] ( < user_ mask> )
if ( " %tmp " ! = " " ) % property = $ reguser . property ( % tmp , < property_name > )
[ / example ]
@ seealso :
@ -1120,7 +1120,7 @@ static bool reguser_kvs_fnc_property(KviKvsModuleFunctionCall * c)
[ doc : registered_users ] Registered users database [ / doc ] ,
[ cmd ] reguser . add [ / cmd ] ,
[ cmd ] reguser . remove [ / cmd ] ,
[ cmd ] reguser . add tq mask[ / cmd ] ,
[ cmd ] reguser . add mask[ / cmd ] ,
[ fnc ] $ reguser . list [ / fnc ] ,
[ fnc ] $ reguser . match [ / fnc ] ,
[ fnc ] $ reguser . property [ / fnc ]
@ -1131,13 +1131,13 @@ static bool reguser_kvs_fnc_matchProperty(KviKvsModuleFunctionCall * c)
TQString szMask ;
TQString szProperty ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " user_ tq mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " user_ mask" , KVS_PT_STRING , 0 , szMask )
KVSM_PARAMETER ( " property_name " , KVS_PT_STRING , KVS_PF_OPTIONAL , szProperty )
KVSM_PARAMETERS_END ( c )
KviIrcMask tq mask( szMask ) ;
//FIXME: it crashes kvirc KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser( tq mask.nick(),tq mask.user(),tq mask.host());
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findMatchingUser ( tq mask. nick ( ) , tq mask. user ( ) , tq mask. host ( ) ) ;
KviIrcMask mask( szMask ) ;
//FIXME: it crashes kvirc KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser( mask.nick(),mask.user(),mask.host());
KviRegisteredUser * u = g_pRegisteredUserDataBase - > findMatchingUser ( mask. nick ( ) , mask. user ( ) , mask. host ( ) ) ;
if ( u )
{
TQString tmp ;
@ -1158,10 +1158,10 @@ static bool reguser_kvs_fnc_matchProperty(KviKvsModuleFunctionCall * c)
@ short :
Shows a registration wizard dialog
@ syntax :
reguser . wizard [ tq mask]
reguser . wizard [ mask]
@ description :
Allows registering an user with an intuitive and easy to use interface .
If [ tq mask] is specified , it is used as inital tq mask in the dialog .
If [ mask] is specified , it is used as inital mask in the dialog .
@ seealso :
[ module : reguser ] Registered users database interface [ / module ] ,
[ doc : registered_users ] Registered users database [ / doc ] ,
@ -1172,7 +1172,7 @@ static bool reguser_kvs_cmd_wizard(KviKvsModuleCommandCall * c)
{
TQString szMask ;
KVSM_PARAMETERS_BEGIN ( c )
KVSM_PARAMETER ( " tq mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETER ( " mask" , KVS_PT_STRING , KVS_PF_OPTIONAL , szMask )
KVSM_PARAMETERS_END ( c )
KviRegistrationWizard * w = new KviRegistrationWizard ( szMask ) ;
@ -1188,8 +1188,8 @@ static bool reguser_module_init(KviModule * m)
KVSM_REGISTER_SIMPLE_COMMAND ( m , " add " , reguser_kvs_cmd_add ) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " remove " , reguser_kvs_cmd_remove ) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " add tq mask" , reguser_kvs_cmd_add tq mask) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " del tq mask" , reguser_kvs_cmd_del tq mask) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " add mask" , reguser_kvs_cmd_add mask) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " del mask" , reguser_kvs_cmd_del mask) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " edit " , reguser_kvs_cmd_edit ) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " showlist " , reguser_kvs_cmd_showlist ) ;
KVSM_REGISTER_SIMPLE_COMMAND ( m , " setproperty " , reguser_kvs_cmd_setproperty ) ;
@ -1200,7 +1200,7 @@ static bool reguser_module_init(KviModule * m)
KVSM_REGISTER_FUNCTION ( m , " match " , reguser_kvs_fnc_match ) ;
KVSM_REGISTER_FUNCTION ( m , " list " , reguser_kvs_fnc_list ) ;
KVSM_REGISTER_FUNCTION ( m , " exactMatch " , reguser_kvs_fnc_exactMatch ) ;
KVSM_REGISTER_FUNCTION ( m , " tq mask" , reguser_kvs_fnc_ tq mask) ;
KVSM_REGISTER_FUNCTION ( m , " mask" , reguser_kvs_fnc_ mask) ;
KVSM_REGISTER_FUNCTION ( m , " property " , reguser_kvs_fnc_property ) ;
KVSM_REGISTER_FUNCTION ( m , " matchProperty " , reguser_kvs_fnc_matchProperty ) ;
KVSM_REGISTER_FUNCTION ( m , " getIgnoreFlags " , reguser_kvs_fnc_getIgnoreFlags ) ;