зеркало из https://github.com/mozilla/pjs.git
Bug 330164 - Use nickname!*@* for ban masks when the hostname is not yet available.
ChatZilla only. r=samuel p=rdmsoft@bugs.rdmsoft.com (Robert Marshall)
This commit is contained in:
Родитель
ec9b92abe0
Коммит
5756a51e62
|
@ -3090,6 +3090,9 @@ function usr_hostmask (pfx)
|
|||
CIRCUser.prototype.getBanMask =
|
||||
function usr_banmask()
|
||||
{
|
||||
if (!this.host)
|
||||
return this.unicodeName + "!*@*";
|
||||
|
||||
var hostmask = this.host;
|
||||
if (!/^\d+\.\d+\.\d+\.\d+$/.test(hostmask))
|
||||
hostmask = hostmask.replace(/^[^.]+/, "*");
|
||||
|
@ -3292,7 +3295,7 @@ function cusr_setban (f)
|
|||
return false;
|
||||
|
||||
var modifier = (f) ? " +b " : " -b ";
|
||||
modifier += this.getBanMask() + " ";
|
||||
modifier += fromUnicode(this.getBanMask(), server) + " ";
|
||||
|
||||
server.sendData("MODE " + this.parent.encodedName + modifier + "\n");
|
||||
|
||||
|
@ -3308,7 +3311,8 @@ function cusr_kban (reason)
|
|||
return false;
|
||||
|
||||
reason = (typeof reason != "undefined") ? reason : this.encodedName;
|
||||
var modifier = " -o+b " + this.encodedName + " " + this.getBanMask() + " ";
|
||||
var modifier = " -o+b " + this.encodedName + " " +
|
||||
fromUnicode(this.getBanMask(), server) + " ";
|
||||
|
||||
server.sendData("MODE " + this.parent.encodedName + modifier + "\n" +
|
||||
"KICK " + this.parent.encodedName + " " +
|
||||
|
|
|
@ -853,7 +853,7 @@ function cmdBanOrExcept(e)
|
|||
if (e.user)
|
||||
{
|
||||
// We have a real user object, so get their proper 'ban mask'.
|
||||
mask = e.user.getBanMask();
|
||||
mask = fromUnicode(e.user.getBanMask(), e.server);
|
||||
}
|
||||
else if (e.nickname)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче