зеркало из https://github.com/mozilla/pjs.git
Bug 299521 - Add /userhost, /userip, /time commands, update /name and /desc commands.
ChatZilla only. r=rginda p=gijskruitbosch+bugs@gmail.com (Gijs Kruitbosch)
This commit is contained in:
Родитель
c52ee943d3
Коммит
9dd8555b26
|
@ -860,6 +860,18 @@ function serv_uptimer()
|
|||
this.lastPing = this.lastPingSent = new Date();
|
||||
}
|
||||
|
||||
CIRCServer.prototype.userhost =
|
||||
function serv_userhost(target)
|
||||
{
|
||||
this.sendData("USERHOST " + fromUnicode(target, this) + "\n");
|
||||
}
|
||||
|
||||
CIRCServer.prototype.userip =
|
||||
function serv_userip(target)
|
||||
{
|
||||
this.sendData("USERIP " + fromUnicode(target, this) + "\n");
|
||||
}
|
||||
|
||||
CIRCServer.prototype.who =
|
||||
function serv_who(target)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,7 @@ function initCommands()
|
|||
["ctcp", cmdCTCP, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["default-charset", cmdCharset, CMD_CONSOLE],
|
||||
["delete-view", cmdDeleteView, CMD_CONSOLE],
|
||||
["desc", cmdDesc, CMD_CONSOLE],
|
||||
["disable-plugin", cmdAblePlugin, CMD_CONSOLE],
|
||||
["disconnect", cmdDisconnect, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["disconnect-all", cmdDisconnectAll, CMD_CONSOLE],
|
||||
|
@ -129,6 +130,7 @@ function initCommands()
|
|||
["motd", cmdSimpleCommand, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["motif", cmdMotif, CMD_CONSOLE],
|
||||
["msg", cmdMsg, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["name", cmdName, CMD_CONSOLE],
|
||||
["names", cmdNames, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["network", cmdNetwork, CMD_CONSOLE],
|
||||
["network-motif", cmdMotif, CMD_NEED_NET | CMD_CONSOLE],
|
||||
|
@ -170,6 +172,7 @@ function initCommands()
|
|||
["sync-window", cmdSync, 0],
|
||||
["testdisplay", cmdTestDisplay, CMD_CONSOLE],
|
||||
["text-direction", cmdTextDirection, 0],
|
||||
["time", cmdTime, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["timestamps", cmdTimestamps, CMD_CONSOLE],
|
||||
["timestamp-format", cmdTimestampFormat, CMD_CONSOLE],
|
||||
["toggle-ui", cmdToggleUI, CMD_CONSOLE],
|
||||
|
@ -179,10 +182,13 @@ function initCommands()
|
|||
["unban", cmdBan, CMD_NEED_CHAN | CMD_CONSOLE],
|
||||
["unstalk", cmdUnstalk, CMD_CONSOLE],
|
||||
["urls", cmdURLs, CMD_CONSOLE],
|
||||
["user", cmdUser, CMD_CONSOLE],
|
||||
["userhost", cmdUserhost, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["userip", cmdUserip, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["usermode", cmdUsermode, CMD_CONSOLE],
|
||||
["user-motif", cmdMotif, CMD_NEED_USER | CMD_CONSOLE],
|
||||
["user-pref", cmdPref, CMD_NEED_USER | CMD_CONSOLE],
|
||||
["version", cmdVersion, CMD_CONSOLE],
|
||||
["version", cmdVersion, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["who", cmdWho, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["whois", cmdWhoIs, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
["whowas", cmdWhoWas, CMD_NEED_SRV | CMD_CONSOLE],
|
||||
|
@ -192,9 +198,7 @@ function initCommands()
|
|||
["css", "motif", CMD_CONSOLE],
|
||||
["exit", "quit", CMD_CONSOLE],
|
||||
["exit-mozilla", "quit-mozilla", CMD_CONSOLE],
|
||||
["desc", "pref desc", CMD_CONSOLE],
|
||||
["j", "join", CMD_CONSOLE],
|
||||
["name", "pref username", CMD_CONSOLE],
|
||||
["part", "leave", CMD_CONSOLE],
|
||||
["raw", "quote", CMD_CONSOLE],
|
||||
// Used to display a nickname in the menu only.
|
||||
|
@ -246,7 +250,7 @@ function initCommands()
|
|||
|
||||
var restList = ["reason", "action", "text", "message", "params", "font",
|
||||
"expression", "ircCommand", "prefValue", "newTopic",
|
||||
"commandList", "file", "commands"];
|
||||
"commandList", "file", "commands", "description"];
|
||||
client.commandManager.argTypes.__aliasTypes__(restList, "rest");
|
||||
client.commandManager.argTypes["plugin"] = parsePlugin;
|
||||
}
|
||||
|
@ -1556,6 +1560,36 @@ function cmdClearView(e)
|
|||
syncOutputFrame(e.view);
|
||||
}
|
||||
|
||||
function cmdDesc(e)
|
||||
{
|
||||
if (e.network != null) // somewhere on a network
|
||||
{
|
||||
dispatch("network-pref", {prefValue: e.description, prefName: "desc",
|
||||
network: e.network,
|
||||
isInteractive: e.isInteractive});
|
||||
}
|
||||
else // no network, change the general pref
|
||||
{
|
||||
dispatch("pref", {prefName: "desc", prefValue: e.description,
|
||||
isInteractive: e.isInteractive});
|
||||
}
|
||||
}
|
||||
|
||||
function cmdName(e)
|
||||
{
|
||||
if (e.network != null) // somewhere on a network
|
||||
{
|
||||
dispatch("network-pref", {prefName: "username", prefValue: e.username,
|
||||
network: e.network,
|
||||
isInteractive: e.isInteractive});
|
||||
}
|
||||
else // no network, change the general pref
|
||||
{
|
||||
dispatch("pref", {prefName: "username", prefValue: e.username,
|
||||
isInteractive: e.isInteractive});
|
||||
}
|
||||
}
|
||||
|
||||
function cmdNames(e)
|
||||
{
|
||||
if (e.channelName)
|
||||
|
@ -2762,7 +2796,10 @@ function cmdPrint(e)
|
|||
|
||||
function cmdVersion(e)
|
||||
{
|
||||
e.network.dispatch("ctcp", { target: e.nickname, code: "VERSION"});
|
||||
if (e.nickname)
|
||||
e.network.dispatch("ctcp", { target: e.nickname, code: "VERSION"});
|
||||
else
|
||||
e.server.sendData(fromUnicode("VERSION") + "\n", e.sourceObject);
|
||||
}
|
||||
|
||||
function cmdEcho(e)
|
||||
|
@ -2953,6 +2990,36 @@ function cmdUnstalk(e)
|
|||
display(getMsg(MSG_ERR_UNKNOWN_STALK, e.text), MT_ERROR);
|
||||
}
|
||||
|
||||
function cmdUser(e)
|
||||
{
|
||||
dispatch("name", {username: e.username, network: e.network,
|
||||
isInteractive: e.isInteractive});
|
||||
dispatch("desc", {description: e.description, network: e.network,
|
||||
isInteractive: e.isInteractive});
|
||||
}
|
||||
|
||||
function cmdUserhost(e)
|
||||
{
|
||||
var nickList = combineNicks(e.nicknameList, 5);
|
||||
for (var i = 0; i < nickList.length; i++)
|
||||
{
|
||||
e.server.userhost(nickList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function cmdUserip(e)
|
||||
{
|
||||
// Check if the server supports this
|
||||
if (!e.server.servCmds.userip)
|
||||
{
|
||||
display(getMsg(MSG_ERR_UNSUPPORTED_COMMAND, "USERIP"), MT_ERROR);
|
||||
return;
|
||||
}
|
||||
var nickList = combineNicks(e.nicknameList, 5);
|
||||
for (var i = 0; i < nickList.length; i++)
|
||||
e.server.userip(nickList[i]);
|
||||
}
|
||||
|
||||
function cmdUsermode(e)
|
||||
{
|
||||
if (e.newMode)
|
||||
|
@ -3313,6 +3380,14 @@ function cmdDoCommand(e)
|
|||
}
|
||||
}
|
||||
|
||||
function cmdTime(e)
|
||||
{
|
||||
if (e.nickname)
|
||||
e.network.dispatch("ctcp", { target: e.nickname, code: "TIME"});
|
||||
else
|
||||
e.server.sendData(fromUnicode("TIME") + "\n", e.sourceObject);
|
||||
}
|
||||
|
||||
function cmdTimestamps(e)
|
||||
{
|
||||
var view = e.sourceObject;
|
||||
|
|
|
@ -218,8 +218,8 @@ cmd.deop.label = Remove Operator Status
|
|||
cmd.deop.params = <nickname> [<...>]
|
||||
cmd.deop.help = Removes operator status from <nickname> on current channel. Requires operator status.
|
||||
|
||||
cmd.desc.params = <description>
|
||||
cmd.desc.help = Changes the 'ircname' line returned when someone performs a /whois on you. You must specify this *before* connecting to the network.
|
||||
cmd.desc.params = [<description>]
|
||||
cmd.desc.help = Changes the 'ircname' line returned when someone performs a /whois on you. You must specify this *before* connecting to the network. If you omit <description>, the current description is shown.
|
||||
|
||||
cmd.devoice.label = Remove Voice Status
|
||||
cmd.devoice.params = <nickname> [<...>]
|
||||
|
@ -378,6 +378,9 @@ cmd.unban.format = Un-ban from $channelName
|
|||
cmd.unban.params = <nickname>
|
||||
cmd.unban.help = Removes the ban on a single user, or removes a specific ban mask from the channel's ban list.
|
||||
|
||||
cmd.user.params = [<username> <description>]
|
||||
cmd.user.help = Sets your username to <username> and your description (``Real Name'') to <description>. Equivalent to using the |name| and |desc| command. The new name and description will be used the next time you connect to the network. You can use this command without parameters to show the current username and description.
|
||||
|
||||
cmd.userlist.help = Toggles the visibility of the user list.
|
||||
|
||||
cmd.ignore.params = [<mask>]
|
||||
|
@ -454,8 +457,8 @@ cmd.motif-light.label = &Light Motif
|
|||
cmd.msg.params = <nickname> <message>
|
||||
cmd.msg.help = Sends the private message <message> to <nickname>.
|
||||
|
||||
cmd.name.params = <username>
|
||||
cmd.name.help = Changes the username displayed before your hostmask if the server you're connecting to allows it. Some servers will only trust the username reply from the ident service. You must specify this *before* connecting to the network.
|
||||
cmd.name.params = [<username>]
|
||||
cmd.name.help = Changes the username displayed before your hostmask if the server you're connecting to allows it. Some servers will only trust the username reply from the ident service. You must specify this *before* connecting to the network. If you omit <username>, the current username will be shown.
|
||||
|
||||
cmd.names.params = [<channel-name>]
|
||||
cmd.names.help = Lists the users in a channel.
|
||||
|
@ -501,6 +504,9 @@ cmd.save.help = Save the current view as file <filename>. If <filename> is omitt
|
|||
cmd.say.params = <message>
|
||||
cmd.say.help = Sends a message to the current view.
|
||||
|
||||
cmd.time.params = [<nickname>]
|
||||
cmd.time.help = Asks <nickname> what time it is on their machine. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not. If you do not specify <nickname>, ChatZilla will ask the server for the time it is on the server.
|
||||
|
||||
cmd.timestamps.params = [<toggle>]
|
||||
cmd.timestamps.help = Sets the visibility of timestamps in the current view. If <toggle> is provided and is |true|, |on|, |yes|, or |1|, timestamps will be turned on. Values |false|, |off|, |no| and |0| will turn timestamps off, and |toggle| will toggle the state. Omit <toggle> to see the current state.
|
||||
|
||||
|
@ -578,6 +584,12 @@ cmd.unstalk.help = Remove word from list of terms for which you would like to
|
|||
cmd.urls.params = [<number>]
|
||||
cmd.urls.help = Displays the last few URLs seen by ChatZilla. Specify <number> to change how many it displays, or omit to display the default 10.
|
||||
|
||||
cmd.userhost.params = <nickname> [<...>]
|
||||
cmd.userhost.help = Requests the hostmask of every <nickname> given.
|
||||
|
||||
cmd.userip.params = <nickname> [<...>]
|
||||
cmd.userip.help = Requests the IP-address of every <nickname> given.
|
||||
|
||||
cmd.disable-plugin.params = <plugin>
|
||||
cmd.disable-plugin.help = This command calls the plugin's disablePlugin function, if it exists. There are no guarantees that the plugin will properly disable itself.
|
||||
|
||||
|
@ -591,8 +603,8 @@ cmd.user-pref.params = [<pref-name> [<pref-value> [<delete-pref> [<user>]]]]
|
|||
cmd.user-pref.help = Sets the value of the preference named <pref-name> to the value of <pref-value> on the user <user>. If <pref-value> is not provided, the current value of <pref-name> will be displayed. If both <pref-name> and <pref-value> are omitted, all preferences will be displayed. If <delete-pref> is provided and is |true|, |on|, |yes|, or |1|, or if <pref-value> starts with a minus ('-') character, then the preference will revert back to its default value. If <user> is not provided, the current user is assumed.
|
||||
|
||||
cmd.version.label = Get Version Information
|
||||
cmd.version.params = <nickname>
|
||||
cmd.version.help = Asks <nickname> what irc client they're running. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not.
|
||||
cmd.version.params = [<nickname>]
|
||||
cmd.version.help = Asks <nickname> what irc client they're running. Their IRC client may or may not show them that you've asked for this information. ChatZilla currently does not. If you do not specify <nickname>, ChatZilla will ask the server for the version of the IRCserver software it is running.
|
||||
|
||||
cmd.voice.label = Give Voice Status
|
||||
cmd.voice.params = <nickname> [<...>]
|
||||
|
@ -659,6 +671,7 @@ msg.err.no.ctcp.cmd = %S is not a valid CTCP function for this client
|
|||
msg.err.no.ctcp.help = %S does not have any help information
|
||||
msg.err.unknown.host = The host application URL "%S" is not recognised. Please report what application you are running ChatZilla in, and the URL given.
|
||||
msg.err.unable.to.print = The current view does not support printing.
|
||||
msg.err.unsupported.command = The server does not support the ``%S'' command.
|
||||
|
||||
# Better IRC error messages
|
||||
msg.err.irc.464 = Incorrect password, please try again with the correct password.
|
||||
|
|
Загрузка…
Ссылка в новой задаче