Bug 338710 - Show server mode changes.

ChatZilla only.
p=rdmsoft@bugs.rdmsoft.com (Robert Marshall)
r=silver
This commit is contained in:
silver%warwickcompsoc.co.uk 2006-07-21 16:14:38 +00:00
parent 42e6379952
commit d6f309ad90
4 changed files with 57 additions and 19 deletions

View File

@ -1893,28 +1893,47 @@ function cmdDescribe(e)
function cmdMode(e)
{
// get our canonical channel name, so we know what channel we talk about
var chan = fromUnicode(e.target, e.server);
var chan;
// Make sure the user can leave the channel name out from a channel view.
if (e.channel && /^[\+\-].+/.test(e.target) &&
!(e.server.toLowerCase(chan) in e.server.channels))
if ((!e.target || /^[\+\-].+/.test(e.target)) &&
!(chan && e.server.getChannel(chan)))
{
chan = e.channel.canonicalName;
if (e.param && e.modestr)
if (e.channel)
{
e.paramList.unshift(e.modestr);
chan = e.channel.canonicalName;
if (e.param && e.modestr)
{
e.paramList.unshift(e.modestr);
}
else if (e.modestr)
{
e.paramList = [e.modestr];
e.param = e.modestr;
}
e.modestr = e.target;
}
else if (e.modestr)
else
{
e.paramList = [e.modestr];
e.param = e.modestr;
display(getMsg(MSG_ERR_REQUIRED_PARAM, "target"), MT_ERROR);
return;
}
e.modestr = e.target;
}
else
{
chan = fromUnicode(e.target, e.server);
}
// Check whether our mode string makes sense
if (!(/^([+-][a-z]+)+$/i).test(e.modestr))
if (!e.modestr)
{
e.modestr = "";
if (!e.channel && arrayContains(e.server.channelTypes, chan[0]))
e.channel = new CIRCChannel(e.server, null, chan);
if (e.channel)
e.channel.pendingModeReply = true;
}
else if (!(/^([+-][a-z]+)+$/i).test(e.modestr))
{
display(getMsg(MSG_ERR_INVALID_MODE, e.modestr), MT_ERROR);
return;
@ -1923,7 +1942,6 @@ function cmdMode(e)
var params = (e.param) ? " " + e.paramList.join(" ") : "";
e.server.sendData("MODE " + chan + " " + fromUnicode(e.modestr, e.server) +
params + "\n");
}
function cmdMotif(e)

View File

@ -2202,6 +2202,12 @@ function my_endofexcepts(e)
this.display(getMsg(MSG_EXCEPTLIST_END, this.unicodeName), "EXCEPT");
}
CIRCChannel.prototype.on482 =
function my_needops(e)
{
this.display(getMsg(MSG_CHANNEL_NEEDOPS, this.unicodeName), MT_ERROR);
}
CIRCChannel.prototype.onNotice =
function my_notice (e)
{
@ -2392,14 +2398,25 @@ function my_ckick (e)
CIRCChannel.prototype.onChanMode =
function my_cmode (e)
{
if ("user" in e)
if (e.code == "MODE")
{
var msg = e.decodeParam(1);
for (var i = 2; i < e.params.length; i++)
msg += " " + e.decodeParam(i);
this.display (getMsg(MSG_MODE_CHANGED, [msg, e.user.unicodeName]),
"MODE", e.user, this);
var source = e.user ? e.user.unicodeName : e.source;
this.display(getMsg(MSG_MODE_CHANGED, [msg, source]),
"MODE", (e.user || null), this);
}
else if ("pendingModeReply" in this)
{
var msg = e.decodeParam(3);
for (var i = 4; i < e.params.length; i++)
msg += " " + e.decodeParam(i);
var view = ("messages" in this && this.messages) ? this : e.network;
view.display(getMsg(MSG_MODE_ALL, [this.unicodeName, msg]), "MODE");
delete this.pendingModeReply;
}
var updates = new Array();

View File

@ -43,7 +43,7 @@ const __cz_version = "0.9.74";
const __cz_condition = "green";
const __cz_suffix = "";
const __cz_guid = "59c81df5-4b7a-477b-912d-4e0fdf64e5f2";
const __cz_locale = "0.9.74.2";
const __cz_locale = "0.9.74.3";
var warn;
var ASSERT;

View File

@ -69,7 +69,7 @@
#
### End of notes ###
locale.version = 0.9.74.2
locale.version = 0.9.74.3
locale.error = You are using ChatZilla %1$S, which requires the locale version %2$S. The currently selected locale, %3$S, is version %4$S, and therefore there may be problems running ChatZilla.\n\nIt is strongly advised that you update or remove the ChatZilla locale in question.
# Misc
@ -511,7 +511,7 @@ cmd.me.help = Sends the text <action> to the channel as a statement in the thi
cmd.motd.help = Displays the "Message of the Day", which usually contains information about the network and current server, as well as any usage policies.
cmd.mode.params = <target> [<modestr> [<param> [<...>]]]
cmd.mode.params = [<target>] [<modestr> [<param> [<...>]]]
cmd.mode.help = Changes the channel or user mode of <target> using <modestr> and any subsequent <param> if added. When used from a channel view, <target> may be omitted. For a list of modes you may use, see http://irchelp.org.
cmd.motif.params = [<motif>]
@ -978,6 +978,8 @@ msg.exceptlist.item = "%S excepted %S from bans in %S on %S.
msg.exceptlist.button = [[Remove][Remove this ban exception][%S]]
msg.exceptlist.end = End of %S exception list.
msg.channel.needops = You need to be an operator in %S to do that.
msg.ctcphelp.clientinfo = CLIENTINFO gives information on available CTCP commands
msg.ctcphelp.action = ACTION performs an action at the user
msg.ctcphelp.time = TIME gives the local date and time for the client
@ -1187,6 +1189,7 @@ msg.someone.left.reason = "%S has left %S (%S)
msg.youre.gone = YOU (%S) have been booted from %S by %S (%S)
msg.someone.gone = "%S was booted from %S by %S (%S)
msg.mode.all = Mode for %S is %S"
msg.mode.changed = Mode %S by %S"
msg.away.on = You are now marked as away (%S). Click the nickname button or use the |/back| command to return from being away.