rename the following methods:

tqparent parent
tqmask mask


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1246260 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 12 years ago
parent 72aaee9802
commit 9ca32ef31a

@ -234,9 +234,9 @@ alias(kb)
{
if(%nick)
{
%tqmask = $tqmask(%nick,$option(uintDefaultBanType));
%mask = $mask(%nick,$option(uintDefaultBanType));
if(!%tqmask)%tqmask = %nick; # plain ban
if(!%mask)%mask = %nick; # plain ban
%reason = $1-
#if(!%reason)%reason = "You're not welcome here!"
@ -250,8 +250,8 @@ alias(kb)
# kick %nick %reason
if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %tqmask"
else %raw2 = "mode $target +b %tqmask"
if($chan.isOp(%nick))%raw2 = "mode $target -o+b %nick %mask"
else %raw2 = "mode $target +b %mask"
raw -q %raw2$cr$lf%raw
}
@ -484,28 +484,28 @@ alias(awayall)
alias(notify)
{
# This one adds a registered users database entry
# For the specified nick and uses the specified tqmask
# If no tqmask is specified , a default one is constructed
# For the specified nick and uses the specified mask
# If no mask is specified , a default one is constructed
# Then the "notify" property is set for the user
if(!$0)
{
echo $tr("Usage:")
echo " /notify <nick> [tqmask]"
echo " /notify <nick> [mask]"
halt
}
# Get the tqmask
# Get the mask
%tqmask = $1
%mask = $1
# no tqmask specified ? build it
# no mask specified ? build it
if(!%tqmask)%tqmask = $0!*@*
if(!%mask)%mask = $0!*@*
# Now add the user (but do not replace old entries)
reguser.add -f -q $0 %tqmask
reguser.add -f -q $0 %mask
# Merge the notify property part with the old one (if any)
@ -526,8 +526,8 @@ alias(notify)
alias(ignore)
{
# This one adds a registered users database entry
# For the specified nick and uses the specified tqmask
# If no tqmask is specified , a default one is constructed
# For the specified nick and uses the specified mask
# If no mask is specified , a default one is constructed
# Then the "ignore" property is set for the user to 1
if(!$0)
@ -539,7 +539,7 @@ alias(ignore)
# Now add the user (but do not replace old entries)
reguser.add $0 $tqmask($0,15);
reguser.add $0 $mask($0,15);
# And finally set the property (use -n so the notify lists will be restarted)
# Check if ignore or unignore the user

@ -9,7 +9,7 @@ defpopup(highlight)
prologue
{
if($0!=""){
%:regName = $reguser.match($tqmask($0))
%:regName = $reguser.match($mask($0))
%:beingHl = $reguser.property(%:regName,highlight)
%:beingHlTmp = $tmphighlight.ishighlighted($0)
}
@ -27,34 +27,34 @@ defpopup(highlight)
popup($tr("Always Highlight")) (!%:beingHl && !%:regName)
{
item($tr("Highlight as") $0 "("$tqmask($0,11)")") ("$reguser.exactMatch($tqmask($0,11))" == "")
item($tr("Highlight as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
{
reguser.add $0 $tqmask($0,11); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,11); reguser.setproperty $0 highlight 1;
}
item($tr("Highlight as") $0 "("$tqmask($0,12)")") ("$reguser.exactMatch($tqmask($0,12))" == "")
item($tr("Highlight as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
{
reguser.add $0 $tqmask($0,12); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,12); reguser.setproperty $0 highlight 1;
}
item($tr("Highlight as") $0 "("$tqmask($0,13)")") ("$reguser.exactMatch($tqmask($0,13))" == "")
item($tr("Highlight as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
{
reguser.add $0 $tqmask($0,13); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,13); reguser.setproperty $0 highlight 1;
}
item($tr("Highlight as") $0 "("$tqmask($0,3)")") ("$reguser.exactMatch($tqmask($0,3))" == "")
item($tr("Highlight as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
{
reguser.add $0 $tqmask($0,3); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,3); reguser.setproperty $0 highlight 1;
}
item($tr("Highlight as") $0 "("$tqmask($0,4)")") ("$reguser.exactMatch($tqmask($0,4))" == "")
item($tr("Highlight as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
{
reguser.add $0 $tqmask($0,4); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,4); reguser.setproperty $0 highlight 1;
}
item($tr("Highlight as") $0 "("$tqmask($0,5)")") ("$reguser.exactMatch($tqmask($0,5))" == "")
item($tr("Highlight as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
{
reguser.add $0 $tqmask($0,5); reguser.setproperty $0 highlight 1;
reguser.add $0 $mask($0,5); reguser.setproperty $0 highlight 1;
}
}
@ -74,7 +74,7 @@ defpopup(ignore)
prologue
{
%:inIgnoreList = 0
%:regName = $reguser.match($tqmask($0))
%:regName = $reguser.match($mask($0))
%:ignLabelText = "<p><b>$0</b> "
if(%:regName)
{
@ -97,191 +97,191 @@ defpopup(ignore)
popup($tr("Ignore as..."),44) (!%:inIgnoreList)
{
item($tr("Ignore as") $0 "("$tqmask($0,0)")") ("$reguser.exactMatch($tqmask($0,0))" == "")
item($tr("Ignore as") $0 "("$mask($0,0)")") ("$reguser.exactMatch($mask($0,0))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,0);
if(!%:regName) reguser.add $0 $mask($0,0);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,1)")") ("$reguser.exactMatch($tqmask($0,1))" == "")
item($tr("Ignore as") $0 "("$mask($0,1)")") ("$reguser.exactMatch($mask($0,1))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,1);
if(!%:regName) reguser.add $0 $mask($0,1);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,2)")") ("$reguser.exactMatch($tqmask($0,2))" == "")
item($tr("Ignore as") $0 "("$mask($0,2)")") ("$reguser.exactMatch($mask($0,2))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,2);
if(!%:regName) reguser.add $0 $mask($0,2);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,3)")") ("$reguser.exactMatch($tqmask($0,3))" == "")
item($tr("Ignore as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,3);
if(!%:regName) reguser.add $0 $mask($0,3);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,4)")") ("$reguser.exactMatch($tqmask($0,4))" == "")
item($tr("Ignore as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,4);
if(!%:regName) reguser.add $0 $mask($0,4);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,5)")") ("$reguser.exactMatch($tqmask($0,5))" == "")
item($tr("Ignore as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,5);
if(!%:regName) reguser.add $0 $mask($0,5);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,6)")") ("$reguser.exactMatch($tqmask($0,6))" == "")
item($tr("Ignore as") $0 "("$mask($0,6)")") ("$reguser.exactMatch($mask($0,6))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,6);
if(!%:regName) reguser.add $0 $mask($0,6);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,7)")") ("$reguser.exactMatch($tqmask($0,7))" == "")
item($tr("Ignore as") $0 "("$mask($0,7)")") ("$reguser.exactMatch($mask($0,7))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,7);
if(!%:regName) reguser.add $0 $mask($0,7);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,8)")") ("$reguser.exactMatch($tqmask($0,8))" == "")
item($tr("Ignore as") $0 "("$mask($0,8)")") ("$reguser.exactMatch($mask($0,8))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,8);
if(!%:regName) reguser.add $0 $mask($0,8);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,9)")") ("$reguser.exactMatch($tqmask($0,9))" == "")
item($tr("Ignore as") $0 "("$mask($0,9)")") ("$reguser.exactMatch($mask($0,9))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,9);
if(!%:regName) reguser.add $0 $mask($0,9);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,10)")") ("$reguser.exactMatch($tqmask($0,10))" == "")
item($tr("Ignore as") $0 "("$mask($0,10)")") ("$reguser.exactMatch($mask($0,10))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,10);
if(!%:regName) reguser.add $0 $mask($0,10);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,11)")") ("$reguser.exactMatch($tqmask($0,11))" == "")
item($tr("Ignore as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,11);
if(!%:regName) reguser.add $0 $mask($0,11);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,12)")") ("$reguser.exactMatch($tqmask($0,12))" == "")
item($tr("Ignore as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,12);
if(!%:regName) reguser.add $0 $mask($0,12);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,13)")") ("$reguser.exactMatch($tqmask($0,13))" == "")
item($tr("Ignore as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,13);
if(!%:regName) reguser.add $0 $mask($0,13);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,14)")") ("$reguser.exactMatch($tqmask($0,14))" == "")
item($tr("Ignore as") $0 "("$mask($0,14)")") ("$reguser.exactMatch($mask($0,14))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,14);
if(!%:regName) reguser.add $0 $mask($0,14);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,15)")") ("$reguser.exactMatch($tqmask($0,15))" == "")
item($tr("Ignore as") $0 "("$mask($0,15)")") ("$reguser.exactMatch($mask($0,15))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,15);
if(!%:regName) reguser.add $0 $mask($0,15);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,16)")") ("$reguser.exactMatch($tqmask($0,16))" == "")
item($tr("Ignore as") $0 "("$mask($0,16)")") ("$reguser.exactMatch($mask($0,16))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,16);
if(!%:regName) reguser.add $0 $mask($0,16);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,17)")") ("$reguser.exactMatch($tqmask($0,17))" == "")
item($tr("Ignore as") $0 "("$mask($0,17)")") ("$reguser.exactMatch($mask($0,17))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,17);
if(!%:regName) reguser.add $0 $mask($0,17);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,18)")") ("$reguser.exactMatch($tqmask($0,18))" == "")
item($tr("Ignore as") $0 "("$mask($0,18)")") ("$reguser.exactMatch($mask($0,18))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,18);
if(!%:regName) reguser.add $0 $mask($0,18);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,19)")") ("$reguser.exactMatch($tqmask($0,19))" == "")
item($tr("Ignore as") $0 "("$mask($0,19)")") ("$reguser.exactMatch($mask($0,19))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,19);
if(!%:regName) reguser.add $0 $mask($0,19);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,20)")") ("$reguser.exactMatch($tqmask($0,20))" == "")
item($tr("Ignore as") $0 "("$mask($0,20)")") ("$reguser.exactMatch($mask($0,20))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,20);
if(!%:regName) reguser.add $0 $mask($0,20);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,21)")") ("$reguser.exactMatch($tqmask($0,21))" == "")
item($tr("Ignore as") $0 "("$mask($0,21)")") ("$reguser.exactMatch($mask($0,21))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,21);
if(!%:regName) reguser.add $0 $mask($0,21);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,22)")") ("$reguser.exactMatch($tqmask($0,22))" == "")
item($tr("Ignore as") $0 "("$mask($0,22)")") ("$reguser.exactMatch($mask($0,22))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,22);
if(!%:regName) reguser.add $0 $mask($0,22);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,23)")") ("$reguser.exactMatch($tqmask($0,23))" == "")
item($tr("Ignore as") $0 "("$mask($0,23)")") ("$reguser.exactMatch($mask($0,23))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,23);
if(!%:regName) reguser.add $0 $mask($0,23);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,24)")") ("$reguser.exactMatch($tqmask($0,24))" == "")
item($tr("Ignore as") $0 "("$mask($0,24)")") ("$reguser.exactMatch($mask($0,24))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,24);
if(!%:regName) reguser.add $0 $mask($0,24);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,25)")") ("$reguser.exactMatch($tqmask($0,25))" == "")
item($tr("Ignore as") $0 "("$mask($0,25)")") ("$reguser.exactMatch($mask($0,25))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,25);
if(!%:regName) reguser.add $0 $mask($0,25);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
item($tr("Ignore as") $0 "("$tqmask($0,26)")") ("$reguser.exactMatch($tqmask($0,26))" == "")
item($tr("Ignore as") $0 "("$mask($0,26)")") ("$reguser.exactMatch($mask($0,26))" == "")
{
if(!%:regName) reguser.add $0 $tqmask($0,26);
if(!%:regName) reguser.add $0 $mask($0,26);
reguser.setIgnoreEnabled $0 1;
reguser.setIgnoreFlags -p -c -n -t -i -d $0;
}
@ -301,7 +301,7 @@ defpopup(registration)
# This is really smart...we are loading
# the reguser module only if this popup is being requested (the user effectively
# puts the mouse on the "Registration" item and the sub-popup is being shown)
%:regName = $reguser.match($tqmask($0))
%:regName = $reguser.match($mask($0))
%:labelText = "<p><b>$0</b>";
if(%:regName)
{
@ -322,39 +322,39 @@ defpopup(registration)
item($tr("Register")"...") (!%:regName)
{
reguser.wizard $tqmask($0)
reguser.wizard $mask($0)
}
popup($tr("Quick Registration")) (!%:regName)
{
item($tr("Register as") $0 "("$tqmask($0,11)")") ("$reguser.exactMatch($tqmask($0,11))" == "")
item($tr("Register as") $0 "("$mask($0,11)")") ("$reguser.exactMatch($mask($0,11))" == "")
{
reguser.add $0 $tqmask($0,11)
reguser.add $0 $mask($0,11)
}
item($tr("Register as") $0 "("$tqmask($0,12)")") ("$reguser.exactMatch($tqmask($0,12))" == "")
item($tr("Register as") $0 "("$mask($0,12)")") ("$reguser.exactMatch($mask($0,12))" == "")
{
reguser.add $0 $tqmask($0,12)
reguser.add $0 $mask($0,12)
}
item($tr("Register as") $0 "("$tqmask($0,13)")") ("$reguser.exactMatch($tqmask($0,13))" == "")
item($tr("Register as") $0 "("$mask($0,13)")") ("$reguser.exactMatch($mask($0,13))" == "")
{
reguser.add $0 $tqmask($0,13)
reguser.add $0 $mask($0,13)
}
item($tr("Register as") $0 "("$tqmask($0,3)")") ("$reguser.exactMatch($tqmask($0,3))" == "")
item($tr("Register as") $0 "("$mask($0,3)")") ("$reguser.exactMatch($mask($0,3))" == "")
{
reguser.add $0 $tqmask($0,3)
reguser.add $0 $mask($0,3)
}
item($tr("Register as") $0 "("$tqmask($0,4)")") ("$reguser.exactMatch($tqmask($0,4))" == "")
item($tr("Register as") $0 "("$mask($0,4)")") ("$reguser.exactMatch($mask($0,4))" == "")
{
reguser.add $0 $tqmask($0,4)
reguser.add $0 $mask($0,4)
}
item($tr("Register as") $0 "("$tqmask($0,5)")") ("$reguser.exactMatch($tqmask($0,5))" == "")
item($tr("Register as") $0 "("$mask($0,5)")") ("$reguser.exactMatch($mask($0,5))" == "")
{
reguser.add $0 $tqmask($0,5)
reguser.add $0 $mask($0,5)
}
}
@ -439,7 +439,7 @@ defpopup(channel)
%:itemBanMask = "*!user@*.host.tld"
%:itemBanNick = "nick"
} else {
%:itemBanMask = $tqmask(%:visible,$option(uintDefaultBanType))
%:itemBanMask = $mask(%:visible,$option(uintDefaultBanType))
if("%:itemBanMask" == "*!*@*")%:itemBanName = $tr("&Ban")
%:itemBanNick = %:visible
}
@ -498,7 +498,7 @@ defpopup(channel)
item($tr("Mask for") %:visible,75) (!%:multiple)
{
echo $tqmask($0,11)
echo $mask($0,11)
}
}
@ -576,7 +576,7 @@ defpopup(channel)
item($tr("&Ban") %:visible "("%:itemBanMask")",67) (("%:itemBanMask" != "*!*@*") && %:bCanKB)
{
ban $tqmask($0,$option(uintDefaultBanType))
ban $mask($0,$option(uintDefaultBanType))
}
item(%:itemBanName %:visible "("%:itemBanNick!*@*")",67) (%:bCanKB)
@ -601,7 +601,7 @@ defpopup(channel)
}
separator
item($tr("Configure ban tqmask..."),20)
item($tr("Configure ban mask..."),20)
{
options.edit KviChannelAdvancedOptionsWidget
}
@ -1119,7 +1119,7 @@ defpopup(querytextview)
item($tr("Mask for") $0,75) (!%:multiple)
{
echo $tqmask($0,11)
echo $mask($0,11)
}
}

@ -281,7 +281,7 @@ the only restriction on a channel name is that it SHALL NOT contain
any spaces (' '), a control G (^G or ASCII 7), a comma (','). Space
is used as parameter separator and command is used as a list item
separator by the protocol). A colon (':') can also be used as a
delimiter for the channel tqmask. Channel names are case insensitive.
delimiter for the channel mask. Channel names are case insensitive.
See the protocol grammar rules (section 2.3.1) for the exact syntax
of a channel name.[br]
[p]
@ -414,7 +414,7 @@ The extracted message is parsed into the components <prefix>,
target = nickname / server
msgtarget = msgto *( "," msgto )
msgto = channel / ( user [ "%" host ] "@" servername )
msgto =/ ( user "%" host ) / targettqmask
msgto =/ ( user "%" host ) / targetmask
msgto =/ nickname / ( nickname "!" user "@" host )
channel = ( "#" / "+" / ( "!" channelid ) / "&" ) chanstring
[ ":" chanstring ]
@ -429,7 +429,7 @@ The extracted message is parsed into the components <prefix>,
ip6addr = 1*hexdigit 7( ":" 1*hexdigit )
ip6addr =/ "0:0:0:0:0:" ( "0" / "FFFF" ) ":" ip4addr
nickname = ( letter / special ) *8( letter / digit / special / "-" )
targettqmask = ( "$" / "#" ) tqmask
targetmask = ( "$" / "#" ) mask
; see details on allowed masks in section 3.3.1
chanstring = %x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B
chanstring =/ %x2D-39 / %x3B-FF
@ -493,7 +493,7 @@ is supplied in section 5 (Replies).
[/td][/tr]
[tr][td]
When wildcards are allowed in a string, it is referred as a "tqmask".
When wildcards are allowed in a string, it is referred as a "mask".
[p]
For string matching purposes, the protocol allows the use of two
special characters: '?' (%x3F) to match one and only one character,
@ -503,7 +503,7 @@ characters can be escaped using the character '\' (%x5C).
[pre]
The Augmented BNF syntax for this is:
tqmask = *( nowild / noesc wildone / noesc wildmany )
mask = *( nowild / noesc wildone / noesc wildmany )
wildone = %x3F
wildmany = %x2A
nowild = %x01-29 / %x2B-3E / %x40-FF
@ -638,7 +638,7 @@ the username, hostname and realname of a new user.
The <mode> parameter should be a numeric, and can be used to
automatically set user modes when registering with the server. This
parameter is a bittqmask, with only 2 bits having any signification: if
parameter is a bitmask, with only 2 bits having any signification: if
the bit 2 is set, the user mode 'w' will be set and if the bit 3 is
set, the user mode 'i' will be set. (See Section 3.1.5 "User
Modes").
@ -769,7 +769,7 @@ service. The service may only be known to servers which have a name
matching the distribution. For a matching server to have knowledge
of the service, the network path between that server and the server
on which the service is connected MUST be composed of servers which
names all match the tqmask.
names all match the mask.
The <type> parameter is currently reserved for future usage.
@ -1266,9 +1266,9 @@ PRIVMSG is used to send private messages between users, as well as to
send messages to channels. <msgtarget> is usually the nickname of
the recipient of the message, or a channel name.
The <msgtarget> parameter may also be a host tqmask (#<tqmask>) or server
tqmask ($<tqmask>). In both cases the server will only send the PRIVMSG
to those who have a server or host matching the tqmask. The tqmask MUST
The <msgtarget> parameter may also be a host mask (#<mask>) or server
mask ($<mask>). In both cases the server will only send the PRIVMSG
to those who have a server or host matching the mask. The mask MUST
have at least 1 (one) "." in it and no wildcards following the last
".". This requirement exists to prevent people sending messages to
"#*" or "$*", which would broadcast to all users. Wildcards are the
@ -1389,13 +1389,13 @@ Wildcards are allowed in the <target> parameter.
[tr][td][pre]
Command: LUSERS
Parameters: [ <tqmask> [ <target> ] ]
Parameters: [ <mask> [ <target> ] ]
The LUSERS command is used to get statistics about the size of the
IRC network. If no parameter is given, the reply will be about the
whole net. If a <tqmask> is specified, then the reply will only
whole net. If a <mask> is specified, then the reply will only
concern the part of the network formed by the servers matching the
tqmask. Finally, if the <target> parameter is specified, the request
mask. Finally, if the <target> parameter is specified, the request
is forwarded to that server which will generate the reply.
Wildcards are allowed in the <target> parameter.
@ -1486,13 +1486,13 @@ published this way.
[tr][td][pre]
Command: LINKS
Parameters: [ [ <remote server> ] <server tqmask> ]
Parameters: [ [ <remote server> ] <server mask> ]
With LINKS, a user can list all servernames, which are known by the
server answering the query. The returned list of servers MUST match
the tqmask, or if no tqmask is given, the full list is returned.
the mask, or if no mask is given, the full list is returned.
If <remote server> is given in addition to <server tqmask>, the LINKS
If <remote server> is given in addition to <server mask>, the LINKS
command is forwarded to the first server found that matches that name
(if any), and that server is then required to answer the query.
@ -1545,7 +1545,7 @@ Parameters: <target server> <port> [ <remote server> ]
The CONNECT command can be used to request a server to try to
establish a new connection to another server immediately. CONNECT is
a privileged command and SHOULD be available only to IRC Operators.
If a <remote server> is given and its tqmask doesn't match name of the
If a <remote server> is given and its mask doesn't match name of the
parsing server, the CONNECT attempt is sent to the first match of
remote server. Otherwise the CONNECT attempt is made by the server
processing the request.
@ -1698,7 +1698,7 @@ information about any service which is connected to the network.
[tr][td][pre]
Command: SERVLIST
Parameters: [ <tqmask> [ <type> ] ]
Parameters: [ <mask> [ <type> ] ]
The SERVLIST command is used to list services currently connected to
the network and visible to the user issuing the command. The
@ -1756,20 +1756,20 @@ allowed to.
[tr][td][pre]
Command: WHO
Parameters: [ <tqmask> [ "o" ] ]
Parameters: [ <mask> [ "o" ] ]
The WHO command is used by a client to generate a query which returns
a list of information which 'matches' the <tqmask> parameter given by
the client. In the absence of the <tqmask> parameter, all visible
a list of information which 'matches' the <mask> parameter given by
the client. In the absence of the <mask> parameter, all visible
(users who aren't invisible (user mode +i) and who don't have a
common channel with the requesting client) are listed. The same
result can be achieved by using a <tqmask> of "0" or any wildcard which
result can be achieved by using a <mask> of "0" or any wildcard which
will end up matching every visible user.
The <tqmask> passed to WHO is matched against users' host, server, real
name and nickname if the channel <tqmask> cannot be found.
The <mask> passed to WHO is matched against users' host, server, real
name and nickname if the channel <mask> cannot be found.
If the "o" parameter is passed only operators are returned according
to the <tqmask> supplied.
to the <mask> supplied.
Numeric Replies:
@ -1792,13 +1792,13 @@ to the <tqmask> supplied.
[tr][td][pre]
Command: WHOIS
Parameters: [ <target> ] <tqmask> *( "," <tqmask> )
Parameters: [ <target> ] <mask> *( "," <mask> )
This command is used to query information about particular user.
The server will answer this command with several numeric messages
indicating different statuses of each user which matches the tqmask (if
indicating different statuses of each user which matches the mask (if
you are entitled to see them). If no wildcard is present in the
<tqmask>, any information about that nick which you are allowed to see
<mask>, any information about that nick which you are allowed to see
is presented.
If the <target> parameter is specified, it sends the query to a
@ -2477,26 +2477,26 @@ to 399.
indicate that it is summoning that user.
346 RPL_INVITELIST
"<channel> <invitetqmask>"
"<channel> <invitemask>"
347 RPL_ENDOFINVITELIST
"<channel> :End of channel invite list"
- When listing the 'invitations masks' for a given channel,
a server is required to send the list back using the
RPL_INVITELIST and RPL_ENDOFINVITELIST messages. A
separate RPL_INVITELIST is sent for each active tqmask.
separate RPL_INVITELIST is sent for each active mask.
After the masks have been listed (or if none present) a
RPL_ENDOFINVITELIST MUST be sent.
348 RPL_EXCEPTLIST
"<channel> <exceptiontqmask>"
"<channel> <exceptionmask>"
349 RPL_ENDOFEXCEPTLIST
"<channel> :End of channel exception list"
- When listing the 'exception masks' for a given channel,
a server is required to send the list back using the
RPL_EXCEPTLIST and RPL_ENDOFEXCEPTLIST messages. A
separate RPL_EXCEPTLIST is sent for each active tqmask.
separate RPL_EXCEPTLIST is sent for each active mask.
After the masks have been listed (or if none present)
a RPL_ENDOFEXCEPTLIST MUST be sent.
@ -2548,23 +2548,23 @@ to 399.
the end.
364 RPL_LINKS
"<tqmask> <server> :<hopcount> <server info>"
"<mask> <server> :<hopcount> <server info>"
365 RPL_ENDOFLINKS
"<tqmask> :End of LINKS list"
"<mask> :End of LINKS list"
- In replying to the LINKS message, a server MUST send
replies back using the RPL_LINKS numeric and mark the
end of the list using an RPL_ENDOFLINKS reply.
367 RPL_BANLIST
"<channel> <bantqmask>"
"<channel> <banmask>"
368 RPL_ENDOFBANLIST
"<channel> :End of channel ban list"
- When listing the active 'bans' for a given channel,
a server is required to send the list back using the
RPL_BANLIST and RPL_ENDOFBANLIST messages. A separate
RPL_BANLIST is sent for each active bantqmask. After the
RPL_BANLIST is sent for each active banmask. After the
banmasks have been listed (or if none present) a
RPL_ENDOFBANLIST MUST be sent.
@ -2719,7 +2719,7 @@ to 399.
- reports the server uptime.
243 RPL_STATSOLINE
"O <hosttqmask> * <name>"
"O <hostmask> * <name>"
- reports the allowed hosts from where user may become IRC
operators.
@ -2731,10 +2731,10 @@ to 399.
RPL_UMODEIS is sent back.
234 RPL_SERVLIST
"<name> <server> <tqmask> <type> <hopcount> <info>"
"<name> <server> <mask> <type> <hopcount> <info>"
235 RPL_SERVLISTEND
"<tqmask> <type> :End of service listing"
"<mask> <type> :End of service listing"
- When listing services in reply to a SERVLIST message,
a server is required to send the list back using the
@ -2869,11 +2869,11 @@ to 399.
412 ERR_NOTEXTTOSEND
":No text to send"
413 ERR_NOTOPLEVEL
"<tqmask> :No toplevel domain specified"
"<mask> :No toplevel domain specified"
414 ERR_WILDTOPLEVEL
"<tqmask> :Wildcard in toplevel domain"
"<mask> :Wildcard in toplevel domain"
415 ERR_BADMASK
"<tqmask> :Bad Server/host tqmask"
"<mask> :Bad Server/host mask"
- 412 - 415 are returned by PRIVMSG to indicate that
the message wasn't delivered for some reason.
@ -3180,7 +3180,7 @@ both will removed by use of a server KILL (See Section 3.7.1).
[tr][td]
There is no way to escape the escape character "\" (%x5C). While
this isn't usually a problem, it makes it impossible to form a tqmask
this isn't usually a problem, it makes it impossible to form a mask
with a backslash character ("\") preceding a wildcard.
[/td][/tr]

@ -765,8 +765,8 @@ namespace KviTQString
// s1
// m1
// tqmask1 : *xor
// tqmask2 : xorand*xor
// mask1 : *xor
// mask2 : xorand*xor
// m2
// s2
@ -794,7 +794,7 @@ namespace KviTQString
const TQChar * savePos2 = m2;
while(m1->tqunicode())
{
//loop managed by m1 (initially first tqmask)
//loop managed by m1 (initially first mask)
if(m1->tqunicode()=='*')
{
//Found a wildcard in m1
@ -825,8 +825,8 @@ namespace KviTQString
if(m2->tqunicode() == '*')
{
//A wlidcard in the second string
//Invert the game : tqmask1 <-> tqmask2
//tqmask2 now leads the game...
//Invert the game : mask1 <-> mask2
//mask2 now leads the game...
savePos1 = m1; //aux
m1 = m2; //...swap
m2 = savePos1; //...swap

@ -402,8 +402,8 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2)
// s1
// m1
// tqmask1 : *xor
// tqmask2 : xorand*xor
// mask1 : *xor
// mask2 : xorand*xor
// m2
// s2
@ -423,7 +423,7 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2)
const char * savePos2 = m2;
while(*m1)
{
//loop managed by m1 (initially first tqmask)
//loop managed by m1 (initially first mask)
if(*m1=='*')
{
//Found a wildcard in m1
@ -450,8 +450,8 @@ bool kvi_matchWildExpr(register const char *m1,register const char *m2)
if(*m2 == '*')
{
//A wlidcard in the second string
//Invert the game : tqmask1 <-> tqmask2
//tqmask2 now leads the game...
//Invert the game : mask1 <-> mask2
//mask2 now leads the game...
savePos1 = m1; //aux
m1 = m2; //...swap
m2 = savePos1; //...swap
@ -497,7 +497,7 @@ bool kvi_matchWildExprCS(register const char *m1,register const char *m2)
if(!(m1 && m2 && (*m1)))return false;
const char * savePos1 = 0;
const char * savePos2 = m2;
while(*m1){ //loop managed by m1 (initially first tqmask)
while(*m1){ //loop managed by m1 (initially first mask)
if(*m1=='*'){
//Found a wildcard in m1
savePos1 = ++m1; //move to the next char and save the position...this is our jolly
@ -520,8 +520,8 @@ bool kvi_matchWildExprCS(register const char *m1,register const char *m2)
} else {
if(*m2 == '*'){
//A wlidcard in the second string
//Invert the game : tqmask1 <-> tqmask2
//tqmask2 now leads the game...
//Invert the game : mask1 <-> mask2
//mask2 now leads the game...
savePos1 = m1; //aux
m1 = m2; //...swap
m2 = savePos1; //...swap
@ -554,7 +554,7 @@ bool kvi_matchWildExprWithTerminator(register const char *m1,register const char
const char * savePos2 = m2;
while(NOT_AT_END(m1))
{
//loop managed by m1 (initially first tqmask)
//loop managed by m1 (initially first mask)
if(*m1=='*')
{
//Found a wildcard in m1
@ -588,8 +588,8 @@ bool kvi_matchWildExprWithTerminator(register const char *m1,register const char
if(*m2 == '*')
{
//A wlidcard in the second string
//Invert the game : tqmask1 <-> tqmask2
//tqmask2 now leads the game...
//Invert the game : mask1 <-> mask2
//mask2 now leads the game...
bSwapped = !bSwapped;
savePos1 = m1; //aux
m1 = m2; //...swap

@ -98,13 +98,13 @@ KviMediaType * KviMediaManager::findMediaTypeByIanaType(const char * ianaType)
return 0;
}
KviMediaType * KviMediaManager::findMediaTypeByFileMask(const char * filetqmask)
KviMediaType * KviMediaManager::findMediaTypeByFileMask(const char * filemask)
{
__range_valid(locked());
for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next())
{
// FIXME: #warning "Should this be case sensitive ?"
if(kvi_strEqualCI(mt->szFileMask.ptr(),filetqmask))return mt;
if(kvi_strEqualCI(mt->szFileMask.ptr(),filemask))return mt;
}
return 0;
@ -137,7 +137,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m)
{
if(iWildCount)
{
// the new tqmask has wildcards... if the current one has none, skip it
// the new mask has wildcards... if the current one has none, skip it
int iWildCountExisting = mt->szFileMask.occurences('*');
if(iWildCountExisting)
{
@ -164,7 +164,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m)
}
} // else the current has no wildcards...skip
} else {
// the new tqmask has no wildcards....
// the new mask has no wildcards....
if(mt->szFileMask.contains('*'))
{
// current one has wildcards...insert
@ -433,7 +433,7 @@ KviMediaType * KviMediaManager::findMediaTypeForRegularFile(const char * szFullP
typedef struct _KviDefaultMediaType
{
const char * filetqmask;
const char * filemask;
const char * magicbytes;
const char * ianatype;
const char * description;
@ -489,12 +489,12 @@ void KviMediaManager::load(const char * filename)
insertMediaType(m);
}
for(int u = 0;g_defMediaTypes[u].filetqmask;u++)
for(int u = 0;g_defMediaTypes[u].filemask;u++)
{
if(!findMediaTypeByFileMask(g_defMediaTypes[u].filetqmask))
if(!findMediaTypeByFileMask(g_defMediaTypes[u].filemask))
{
KviMediaType * m = new KviMediaType;
m->szFileMask = g_defMediaTypes[u].filetqmask;
m->szFileMask = g_defMediaTypes[u].filemask;
m->szMagicBytes = g_defMediaTypes[u].magicbytes;
m->szIanaType = g_defMediaTypes[u].ianatype;
m->szDescription = g_defMediaTypes[u].description;

@ -67,7 +67,7 @@ private:
KviMediaType * findMediaTypeForRegularFile(const char * szFullPath,const char * szFileName,bool bCheckMagic);
public:
KviPointerList<KviMediaType> * mediaTypeList(){ return m_pMediaTypeList; };
KviMediaType * findMediaTypeByFileMask(const char * filetqmask);
KviMediaType * findMediaTypeByFileMask(const char * filemask);
KviMediaType * findMediaTypeByIanaType(const char * ianaType);
bool removeMediaType(KviMediaType * t){ return m_pMediaTypeList->removeRef(t); };
void clear(){ m_pMediaTypeList->clear(); };

@ -28,10 +28,10 @@
#include "kvi_config.h"
#include "kvi_qstring.h"
KviRegisteredChannel::KviRegisteredChannel(const KviStr &name,const KviStr &nettqmask)
KviRegisteredChannel::KviRegisteredChannel(const KviStr &name,const KviStr &netmask)
{
m_szName = name;
m_szNetMask = nettqmask;
m_szNetMask = netmask;
m_pPropertyDict = new KviPointerHashTable<const char *,KviStr>(7,false,true);
m_pPropertyDict->setAutoDelete(true);
}
@ -111,13 +111,13 @@ KviRegisteredChannel * KviRegisteredChannelDataBase::find(const char * name,cons
return 0;
}
KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * nettqmask)
KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * netmask)
{
KviRegisteredChannelList * l = m_pChannelDict->find(name);
if(!l)return 0;
for(KviRegisteredChannel * c = l->first();c;c = l->next())
{
if(kvi_strEqualCI(c->netMask().ptr(),nettqmask))return c;
if(kvi_strEqualCI(c->netMask().ptr(),netmask))return c;
}
return 0;
}

@ -35,7 +35,7 @@ class KVILIB_API KviRegisteredChannel : public KviHeapObject
{
friend class KviRegisteredChannelDataBase;
public:
KviRegisteredChannel(const KviStr &name,const KviStr &nettqmask);
KviRegisteredChannel(const KviStr &name,const KviStr &netmask);
~KviRegisteredChannel();
protected:
KviStr m_szName;
@ -63,7 +63,7 @@ protected:
public:
KviPointerHashTable<const char *,KviRegisteredChannelList> * channelDict(){ return m_pChannelDict; };
KviRegisteredChannel * find(const char * name,const char * net);
KviRegisteredChannel * findExact(const char * name,const char * nettqmask);
KviRegisteredChannel * findExact(const char * name,const char * netmask);
void remove(KviRegisteredChannel * c);
void add(KviRegisteredChannel * c);
void load(const char * filename);

@ -42,7 +42,7 @@
@short:
Registration of users in KVIrc
@keyterms:
registered users, registration tqmask, registered user properties,
registered users, registration mask, registered user properties,
user properties, notify property, avatar property
@body:
[big]Introduction[/big][br]
@ -59,7 +59,7 @@
are used to recognize the user on irc.[br]
[br]
[big]Registration masks[/big][br]
The masks have the common IRC tqmask format: [b]<nick>!<user>@<host>[/b][br]
The masks have the common IRC mask format: [b]<nick>!<user>@<host>[/b][br]
The masks may contain '*' and '?' wildcards that match any portion of text.[br]
[b]*!*@*[/b][br]
[b]Pragma!*@*[/b][br]
@ -69,33 +69,33 @@
[b]Pragma!~daemon@some.host.it[/b][br]
Are examples of valid registration masks.[br]
The masks with wildcards can actually match more than a single user.[br]
For example the tqmask *!root@*.host.com will match all the users
For example the mask *!root@*.host.com will match all the users
having root as username and coming from the host.com domain.[br]
For this reason putting wildcards in nicknames could become a problem
if not used carefully (but may also be used to achieve interesting tricks).[br]
If you don't use wildcards in nicknames you are sure that
in a single irc connection , a tqmask will always refer to a single user.[br]
in a single irc connection , a mask will always refer to a single user.[br]
You will commonly use the following format:[br]
<nick>!*<username>@*.<host>.<top>[br]
or[br]
<nick>!*<username>@<number>.<number>.<number>.*[br]
In this way you can be 95% sure that the tqmask will really match the correct user.[br]
In this way you can be 95% sure that the mask will really match the correct user.[br]
[br]
[big]Example of registration and lookups[/big]
Assume that you want to registere a friend of yours: Derek Riggs.[br]
Derek often uses "Eddie" as his nickname
"stranger" as username and has a dial-up connection that makes his IP address appear as
<variable-number>.somewhere.in.time.org.[br]
You will add an entry with name "Derek Riggs" and a registration tqmask like the following:
You will add an entry with name "Derek Riggs" and a registration mask like the following:
Eddie!stranger@*.somewhere.in.time.org.[br]
If the IRC servers keep adding strange characters ([doc:irc_masks]prefixes[/doc]) at the beginning of his username you may use
Eddie!*stranger@*.somewhere.in.time.org.[br]
If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration tqmask as follows:
If Eddie also often connects from the wasted.years.org domain and gets 'eddie' as username there, you might add a second registration mask as follows:
Eddie!*eddie@*.wasted.years.org.[br]
An alternative could be use only one tqmask with *.org as domain and allow any username (Eddie!*@*.org) but this
An alternative could be use only one mask with *.org as domain and allow any username (Eddie!*@*.org) but this
could become dangerous since it could match the users that you don't want to.[br]
On the other hand, if you dislike the users with the nickname Eddie that come from .org
and you're implementing an auto-kick system, the correct tqmask to register is "Eddie!*@*.org".[br]
and you're implementing an auto-kick system, the correct mask to register is "Eddie!*@*.org".[br]
[br]
KVirc ties to be smart , and always find the most correct match for an user:
If you have two masks registered: Pragma!*xor@*.myisp.it and *!*@*.myisp.it,
@ -162,47 +162,47 @@ bool KviRegisteredUser::isIgnoreEnabledFor(IgnoreFlags flag)
return m_iIgnoreFlags & flag;
}
KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &tqmask)
KviIrcMask * KviRegisteredUser::findMask(const KviIrcMask &mask)
{
for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
{
if(*m == tqmask)return m;
if(*m == mask)return m;
}
return 0;
}
bool KviRegisteredUser::addMask(KviIrcMask * tqmask)
bool KviRegisteredUser::addMask(KviIrcMask * mask)
{
if(findMask(*tqmask))
if(findMask(*mask))
{
delete tqmask;
tqmask = 0;
delete mask;
mask = 0;
return false;
}
m_pMaskList->append(tqmask);
m_pMaskList->append(mask);
return true;
}
bool KviRegisteredUser::removeMask(KviIrcMask * tqmask)
bool KviRegisteredUser::removeMask(KviIrcMask * mask)
{
if(!tqmask)return false;
return m_pMaskList->removeRef(tqmask);
if(!mask)return false;
return m_pMaskList->removeRef(mask);
}
bool KviRegisteredUser::matches(const KviIrcMask &tqmask)
bool KviRegisteredUser::matches(const KviIrcMask &mask)
{
for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
{
if(m->matches(tqmask))return true;
if(m->matches(mask))return true;
}
return false;
}
bool KviRegisteredUser::matchesFixed(const KviIrcMask &tqmask)
bool KviRegisteredUser::matchesFixed(const KviIrcMask &mask)
{
for(KviIrcMask * m = m_pMaskList->first();m;m = m_pMaskList->next())
{
if(m->matchesFixed(tqmask))return true;
if(m->matchesFixed(mask))return true;
}
return false;
}
@ -359,9 +359,9 @@ KviRegisteredUser * KviRegisteredUserDataBase::getUser(const TQString & name)
return u;
}
static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,KviIrcMask *tqmask)
static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,KviIrcMask *mask)
{
KviRegisteredMask * newMask = new KviRegisteredMask(u,tqmask);
KviRegisteredMask * newMask = new KviRegisteredMask(u,mask);
int idx = 0;
for(KviRegisteredMask * m = l->first();m;m = l->next())
{
@ -375,20 +375,20 @@ static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,Kv
l->append(newMask);
}
KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * tqmask)
KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * mask)
{
if(!u || !tqmask) return 0;
if(!u || !mask) return 0;
__range_valid(u == m_pUserDict->find(u->name()));
KviRegisteredMaskList * l;
if(tqmask->hasWildNick())
if(mask->hasWildNick())
{
for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next())
{
if(*(m->tqmask()) == *tqmask)
if(*(m->mask()) == *mask)
{
delete tqmask;
tqmask = 0;
delete mask;
mask = 0;
return m->user();
}
}
@ -396,44 +396,44 @@ KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,Kvi
// masks with more info go first in the list
l = m_pWildMaskList;
} else {
l = m_pMaskDict->find(tqmask->nick());
l = m_pMaskDict->find(mask->nick());
if(l)
{
// FIXME: #warning "Here we could compare the host and username only: nick matches for sure"
for(KviRegisteredMask * m = l->first();m;m = l->next())
{
if(*(m->tqmask()) == *tqmask)
if(*(m->mask()) == *mask)
{
delete tqmask;
tqmask = 0;
delete mask;
mask = 0;
return m->user();
}
}
// not found ...ok... add it
} else {
// not found ...ok... add it
// this is the first tqmask in the list
// this is the first mask in the list
l = new KviRegisteredMaskList;
l->setAutoDelete(true);
if(!u->addMask(tqmask))
if(!u->addMask(mask))
{
debug(" Ops...got an incoherent regusers action...recovered ?");
delete l;
l = 0;
} else {
append_mask_to_list(l,u,tqmask);
m_pMaskDict->insert(tqmask->nick(),l);
append_mask_to_list(l,u,mask);
m_pMaskDict->insert(mask->nick(),l);
}
return 0;
}
}
// Ok...add it
if(!u->addMask(tqmask))
if(!u->addMask(mask))
{
debug("ops...got an incoherent regusers action...recovered ?");
return 0; // ops...already there ?
}
append_mask_to_list(l,u,tqmask);
append_mask_to_list(l,u,mask);
return 0;
}
@ -488,9 +488,9 @@ bool KviRegisteredUserDataBase::removeUser(const TQString & name)
if(name.isEmpty()) return false;
KviRegisteredUser * u = m_pUserDict->find(name);
if(!u)return false;
while(KviIrcMask * tqmask = u->maskList()->first())
while(KviIrcMask * mask = u->maskList()->first())
{
if(!removeMaskByPointer(tqmask))
if(!removeMaskByPointer(mask))
debug("Ops... removeMaskByPointer(%s) failed ?",KviTQString::toUtf8(name).data());
}
emit(userRemoved(name));
@ -504,13 +504,13 @@ bool KviRegisteredUserDataBase::removeGroup(const TQString & name)
return true;
}
bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &tqmask)
bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &mask)
{
// find the tqmask pointer
KviRegisteredMask * m = findExactMask(tqmask);
// find the mask pointer
KviRegisteredMask * m = findExactMask(mask);
// and remove it
if(m){
if(removeMaskByPointer(m->tqmask()))
if(removeMaskByPointer(m->mask()))
{
return true;
}
@ -518,36 +518,36 @@ bool KviRegisteredUserDataBase::removeMask(const KviIrcMask &tqmask)
return 0;
}
bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * tqmask)
bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * mask)
{
if(!tqmask) return 0;
if(tqmask->hasWildNick())
if(!mask) return 0;
if(mask->hasWildNick())
{
// remove from the wild list
for(KviRegisteredMask * m = m_pWildMaskList->first();m;m = m_pWildMaskList->next())
{
if(m->tqmask() == tqmask)
if(m->mask() == mask)
{
// ok..got it, remove from the list and from the user struct (user struct deletes it!)
emit(userChanged(tqmask->nick()));
m->user()->removeMask(tqmask); // this one deletes m->tqmask()
emit(userChanged(mask->nick()));
m->user()->removeMask(mask); // this one deletes m->mask()
m_pWildMaskList->removeRef(m); // this one deletes m
return true;
}
}
// not found ...opz :)
} else {
KviRegisteredMaskList * l = m_pMaskDict->find(tqmask->nick());
KviRegisteredMaskList * l = m_pMaskDict->find(mask->nick());
if(l)
{
// FIXME: #warning "Here we could compare the host and username only: nick matches for sure"
for(KviRegisteredMask * m = l->first();m;m = l->next())
{
if(m->tqmask() == tqmask)
if(m->mask() == mask)
{
TQString nick = tqmask->nick();
TQString nick = mask->nick();
emit(userChanged(nick));
m->user()->removeMask(tqmask); // this one deletes m->tqmask() (or tqmask)
m->user()->removeMask(mask); // this one deletes m->mask() (or mask)
l->removeRef(m); // this one deletes m
if(l->count() == 0)m_pMaskDict->remove(nick);
return true;
@ -563,21 +563,21 @@ bool KviRegisteredUserDataBase::removeMaskByPointer(KviIrcMask * tqmask)
/*
KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const KviIrcMask &tqmask)
KviRegisteredUser * KviRegisteredUserDataBase::findMatchingUser(const KviIrcMask &mask)
{
// first lookup the nickname in the maskDict
KviRegisteredMaskList * l = m_pMaskDict->find(tqmask.nick());
KviRegisteredMaskList * l = m_pMaskDict->find(mask.nick());
if(l)
{
for(KviRegisteredMask *m = l->first();m;m = l->next())
{
if(m->tqmask()->matchesFixed(0,tqmask.user(),tqmask.host()))return m->user();
if(m->mask()->matchesFixed(0,mask.user(),mask.host()))return m->user();</