Indy 9
TIdIRCServer
Hierarchy, Properties, Methods, Events, See Also, Unit: IdIrcServer
Specifies an Internet Relay Chat Protocol server.
TIdIRCServer = class(TIdTCPServer)
Unit
IdIrcServer
Description
TIdIRCServer is a TIdTCPServer descendant that provides a server implementation of the Internet Relay Chat (IRC) Protocol as described in the Internet Standards document:

  • RFC 1459 - Internet Relay Chat Protocol (IRC) (http://www.rfc-editor.org/rfc/rfc1459.txt)

The IRC protocol provides users with a way to chat among themselves in "chat rooms". The IRC protocol is a text-based conferencing protocol that uses TCP/IP as the network transport.

A typical IRC environment involves a single process (the server) that forms a central point for client (or other server) connections, performing the required message delivery/multiplexing and other functions. IRC allows various forms of message delivery including user-to-user, user-to-list, user-to-group, user-to-server, and server-to-server communication modes.

The only network configuration allowed for IRC servers is that of a spanning tree where each server acts as a central node for the rest of the network visible to the server.

An IRC client can be any socket-enable application capable of connecting to an IRC server that is not already an IRC server.

TIdIRCServer uses the standard port number IdPORT_IRC reserved for the IRC protocol to listen for client connections. TIdIRCServer, like TIdTCPServer, is a multithreaded application where new connections are respresented by a TIdPeerThread that is serviced by the TIdIRCServer.

TIdIRCServer recognizes the following IRC commands as defined in the RFC specification:

  • ADMIN

  • AWAY

  • CONNECT

  • ERROR

  • INFO

  • INVITE

  • ISON

  • JOIN

  • KICK

  • KILL

  • LINKS

  • LIST

  • MODE

  • NAMES

  • NICK

  • NOTICE

  • OPER

  • PART

  • PASS

  • PING

  • PONG

  • PRIVMSG

  • QUIT

  • REHASH

  • RESTART

  • SERVER

  • SQUIT

  • STATS

  • SUMMON

  • TIME

  • TOPIC

  • TRACE

  • USER

  • USERHOST

  • USERS

  • VERSION

  • WALLOPS

  • WHO

  • WHOIS

  • WHOWAS

TIdIRCServer provides an event handler architecture for all IRC commands that allow the IRC server application to determine the appropriate mechanism used to respond to an IRC command. TIdIRCServer does not provide an implementation for the event handlers.


TIdIRCServer.Create
TIdIRCServer, See Also
Constructor for the object instance.
constructor Create(AOwner: TComponent); override;
Parameters
AOwner: TComponent
Owner of the object instance.
Description
Create is the constructor for the object instance. Create calls the inherited Create method, and sets the value of the default port property to the standard port number used for Internet Relay Chat (IdPORT_IRC).

TIdIRCServer.OnCommandAdmin
TIdIRCServer
Event handler for the IRC ADMIN command.
property OnCommandAdmin: TIdIrcOneParmEvent;
Parameters
Parm
Target server for the command.
Thread
Client generating the event.
Description
OnCommandAdmin is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC ADMIN command. ADMIN is used to retrieve the name of the administrator for the server specified in Parm. An IRC server must be able to forward an ADMIN message to other servers.

Parm can contain wildcard characters to indicate that the first server matching the host name mask. For example:

  • irc.wvnet.edu - request a specific server.

  • *.edu - request the first server found in the edu domain.

TIdIRCServer.OnCommandAway
TIdIRCServer
Event handler for the IRC AWAY command.
property OnCommandAway: TIdIrcOneParmEvent;
Parameters
Parm
Away message for the client.
Thread
Client generating the event.
Description
OnCommandAway is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC AWAY command. AWAY is used to designate the automatic response message for a PRIVMSG message received for a client that is not connected, and to toggle the user's presence status.

When Parm contains text, the user is not available to receive additional messages and the text in Parm should be sent by the server to any clients sending messages to the user. When Parm is an empty string, the user is on-line and can resume receipt of IRC messages. For example:

  • "Gone to Lunch. Back in 30 minutes." - The Away message is active.

  • "" - Away message inactive. User receives messages.

TIdIRCServer.OnCommandConnect
TIdIRCServer
Event handler for IRC CONNECT commands.
property OnCommandConnect: TIdIrcThreeParmEvent;
Parameters
Parm1
Target server for the client connection.
Parm2
Target server port number for the connection.
Parm3
Remote server for the connection.
Thread
Client generating the event.
Description
OnCommandConnect is a TIdIrcThreeParmEvent event handler that allows the server to respond to the IRC CONNECT command. CONNECT is a privileged IRC command available to IRC Operators, and is used to open a connection to another server. CONNECT is used to build the spanning tree that represents the IRC network.

Parm1 is the target server will be the endpoint for the connection.

Parm2 is an optional port number to use for the connection.

Parm3 is an optional server that represents the origin point for the new connection. When Parm3 is an empty string, the origin is the current server.


TIdIRCServer.OnCommandError
TIdIRCServer
Event handler for the IRC ERROR command.
property OnCommandError: TIdIrcOneParmEvent;
Parameters
Parm
Error message to send to IRC operators.
Thread
Client generating the event.
Description
OnCommandError is a TIdIrcOneParmEventevent handler that allows the server to respond to the IRC ERROR command. ERROR is used to report a serious or fatal server error to IRC Operators. ERROR may also send the error message from one server to another server, but must not be accepted from an unknown client.

An ERROR message is used to report errors which occur on the server-to-server link only. An ERROR message is sent to a server at the connection endpoint and all operators currently connected. It is not to be passed onto any other servers by a server if it is received from a server. When a server sends a received ERROR message to operators, the message should be encapsulated in a NOTICE message, indicating that the client was not responsible for the error.


TIdIRCServer.OnCommandInfo
TIdIRCServer
Event handler for the IRC INFO command.
property OnCommandInfo: TIdIrcOneParmEvent;
Parameters
Parm
Target server for the request.
Thread
Client generating the event.
Description
OnCommandInfo is a TIdIrcOneParmEventevent handler that allows the server to respond to the IRC INFO command. INFO is used to retrieve information which describes the server in Parm, including the version number, patch level, date started, and miscellaneous data relevant to server identification.

Parm can contain a server name, a host name mask with wildcard characters, or a user nickname that identifies the target of the INFO request. For example:

  • csd.bu.edu - request information for a specific server.

  • *.edu - request information from the first available server.

  • MyNick - request information from the server where MyNick is connected.

TIdIRCServer.OnCommandInvite
TIdIRCServer
Event handler for the IRC INVITE command.
property OnCommandInvite: TIdIrcTwoParmEvent;
Parameters
Parm1
User Nickname to invite to a channel.
Parm2
Channel name for the invitation.
Thread
Client generating the event.
Description
OnCommandInvite is a TIdIrcTwoParmEvent event handler that allows the server to respond the IRC INVITE command. INVITE is used to invite the user specified in Parm1 to the channel specified in Parm2.

Parm1 contains the Nickname of the user to be invited to a channel.

Parm2 contains the Channel name where the user is to be invited. There is no requirement that Parm2 identifying an existing or valid channel.

To invite a user to a channel which is by invitation only, the client sending the invite must be recognized as being a channel operator on the given channel.


TIdIRCServer.OnCommandIsOn
TIdIRCServer
Event handler for the IRC ISON command.
property OnCommandIsOn: TIdIrcOneParmEvent;
Parameters
Parm
List of nicknames for the command.
Thread
Client generating the event.
Description
OnCommandIsOn is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC ISON command. ISON is used to determine if a user, or list of users, is/are currently connected to the IRC server.

Parm is a user nickname or space-delimited list of user nicknames. For each nickname in the list, the server adds that to its reply string when the user is connected. The list returned may be empty, the same as the original list, or a subset of the original list in Parm. Parm cannot exceed 512 characters.

ISON may only be processed by the server for the client sending the command, and cannot be passed to other servers for further processing.


TIdIRCServer.OnCommandJoin
TIdIRCServer
Event handler for the IRC JOIN command.
property OnCommandJoin: TIdIrcTwoParmEvent;
Parameters
Parm1
List of channels to join.
Parm2
List of keys for the joined channels.
Thread
Client generating the event.
Description
OnCommandJoin is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC JOIN command. JOIN is used to signal that a client wishes to listen for IRC messages on the channels specified in Parm1.

Permissions to join a channel are determined by the server that hosts the client connection. All other servers should add the user to the channel when it is received from the origin server. The local server can add a user under the following circumstances:

  • The user must be invited if the channel is by invitation only.

  • The user's nick/username/hostname must not match any active bans.

  • The correct key (password) must be given if it is set.

When a user has joined a channel, they will receive notice about all commands for their server that affect the channel.

Parm1 contains a channel name, or a list of comma-delimited channel names, where the client should listen for IRC messages.

Parm2 contains a key (password), or a list of comma-delimited keys, for all channels where keys are required.


TIdIRCServer.OnCommandKick
TIdIRCServer
Event handler for the IRC KICK command.
property OnCommandKick: TIdIrcThreeParmEvent;
Parameters
Parm1
Channel name(s).
Parm2
User NickName(s).
Parm3
Reason for the action.
Thread
Client generating the event.
Description
OnCommandKick is a TIdIrcThreeParmEvent event handler that allows the server to respond to the IRC KICK command. KICK is used to forcibly remove the user in Parm2 for the channel in Parm1. Parm3 is the comment or reason message sent to the client. Only a channel operator may use the KICK command.

Each server that receives a KICK message checks that the user is a valid channel operator before removing the victim in Parm2 from the channel.

Notes
The IRC protocol allows extension of the KICK command parameters to allow Parm1 to contain a comma-delimited list of channel names, and Parm2 to contain a comma-delimited list of user Nicknames.

TIdIRCServer.OnCommandKill
TIdIRCServer
Event handler for the IRC KILL command.
property OnCommandKill: TIdIrcTwoParmEvent;
Parameters
Parm1
Nickname for the connection to be closed.
Parm2
Reason or Comment that explains the action.
Thread
Client generating the event.
Description
OnCommandKill is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC KILL command. KILL is used to cause the server connection to the client to be closed on the server that hosts the client connection. KILL is generally used by servers to close connection for duplicates entries in the list of valid NickNames. KILL is also available to channel operators.

Parm1 is the user NickName for the connection to be closed.

Parm2 is a comment that reflects the reason that the connection is closed. The name of the user generating the message and all servers in the IRC network path is prepended to Parm2.

Notes
It is recommended that only channel operators be allowed to KILL user connections.

TIdIRCServer.OnCommandLinks
TIdIRCServer
Event handler for the IRC LINKS command.
property OnCommandLinks: TIdIrcTwoParmEvent;
Parameters
Parm1
Server mask for the query.
Parm2
Optional remote server mask.
Thread
Client generating the event.
Description
OnCommandLinks is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC LINKS command. LINKS is used to retrieve a list of servers matching the mask in Parm1 known to the server answering the query.

Remote server can be a server name, or a server name mask that identifies the server where the command is forwarded for processing. For example:

  • LINKS *.au - lists all servers with a name that matches *.au

  • LINKS *.bu.edu *.edu - lists all servers with a name that matches *.bu.edu on the first server matching *.edu

TIdIRCServer.OnCommandList
TIdIRCServer
Event handler for the IRC LIST command.
property OnCommandList: TIdIrcTwoParmEvent;
Parameters
Parm1
List of channels.
Parm2
Server name.
Thread
Client generating the event.
Description
OnCommandList is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC LIST command. LIST is used to retrieve a list of channels and topics for the specified server.

Parm1 is an optional parameter that identifies a comma-delimited list of channel names where status and topic information should be retrieved.

Parm2 is the server where the list command should be performed.


TIdIRCServer.OnCommandMode
TIdIRCServer
Event handler for the IRC MODE command.
property OnCommandMode: TIdIrcFiveParmEvent;
Parameters
Parm1
Channel or User Nickname.
Parm2
Channel options.
Parm3
Limit on options.
Parm4
Target User Nickname.
Parm5
Ban mask.
Thread
Client generating the event.
Description
OnCommandMode is a TIdIrcFiveParmEvent event handler that allows the server to respond to the IRC MODE command. MODE is a dual-purpose command in IRC that is used to change both username and channel mode information.

Channel mode is provided to allow channel operators to change the characteristics of the channel. In channel mode, Parm2 indicates channel options that include a "+" or "-" character, indicating the action, and one or more of the following channel option characters:

  • o - Give/take channel operator privileges.

  • p - Private channel flag.

  • s - Secret channel flag.

  • i - Invite-only channel flag.

  • t - Topic settable by channel operator only flag.

  • n - No messages to channel from clients on the outside.

  • m - Moderated channel.

  • l - Set the user limit to channel.

  • b - Set a ban mask to keep users out.

  • v - Give/take the ability to speak on a moderated channel.

  • k - Set a channel key (password).

When using the 'o' and 'b' options, a restriction on a total of three per mode command has been imposed.

User mode is provided to allow changes that affect how the user is seen by others, and what extra messages are seen by the client. In User mode, Parm2 indicates user options that include a "+" or "-" character, indicating the action, and one or more of the following user option characters:

  • i - Marks a users as invisible.

  • s - Marks a user for receipt of server notices.

  • w - User receives wallops.

  • o - Operator flag.

If a user attempts to make themselves an operator using the "+o" flag, the attempt should be ignored. There is no restriction, however, on a user removing their operator option flag.


TIdIRCServer.OnCommandNames
TIdIRCServer
Event handler for the IRC NAMES command.
property OnCommandNames: TIdIrcOneParmEvent;
Parameters
Parm
List of channels.
Thread
Client generating the event.
Description
OnCommandNames is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC NAMES command. NAMES is used to retrieve a list of user Nicknames available on the channels in Parm.

Parm should not contain private or secret channels. When Parm is blank, a list of all users on any channel on the server is returned. Users on not on the server, or a visible channel on the server, are placed at the end of the list on channel "*".


TIdIRCServer.OnCommandNick
TIdIRCServer
Event handler for the IRC NICK command.
property OnCommandNick: TIdIrcTwoParmEvent;
Parameters
Parm1
Nickname for the current user.
Parm2
Number of hops to the home server.
Thread
Client generating the event.
Description
OnCommandNick is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC NICK command. Nick is used to assign the Nickname in Parm1 to the current user. If the user already has a Nickname, the Nickname is changed to Parm1.

Parm2 is an optional parameter that contains the number of hops from the home server for the user. A local connection has a hop count of 0. If Parm2 is supplied by a client, it is ignored.

The server cannot allow two users to have an identical Nickname. If a Nickname collision occurs, both connection with the Nickname are closed and the entries are removed from the server database.


TIdIRCServer.OnCommandNotice
TIdIRCServer
Event handler for the IRC NOTICE command.
property OnCommandNotice: TIdIrcTwoParmEvent;
Parameters
Parm1
NickName to receive the message.
Parm2
Content of the message.
Thread
Client generating the request.
Description
OnCommandNotice is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC NOTICE command. NOTICE is used to send the message in Parm2 to the user nickname in Parm1. NOTICE does not generate automatic replies or error messages.

TIdIRCServer.OnCommandOper
TIdIRCServer
Event handler for the IRC OPER command.
property OnCommandOper: TIdIrcTwoParmEvent;
Parameters
Parm1
Username requesting operator permission.
Parm2
Password for the user requesting operator permission.
Thread
Client generating the event.
Description
OnCommandOper is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC OPER command. OPER is used to obtain operator privileges.

Param1 contains the user requesting operator privileges.

Param2 contains the password for the user requesting operator privileges.

If the user and password are valid, the server will inform the remainder of the IRC network using the "MODE +o" command for the client nickname.


TIdIRCServer.OnCommandOther
TIdIRCServer
Event handler for unknown IRC commands.
property OnCommandOther: TIdIrcOtherEvent;
Parameters
Command
Command from the client.
Parm
Command parameters from the client.
Thread
Client generating the event.
Description
OnCommandOther is a TIdIrcOtherEvent event handler that allows the server to respond to unknown IRC commands. OnCommandOther is called when the server encounters a command that is not recognized as an IRC protocol command.

TIdIRCServer.OnCommandPart
TIdIRCServer
Event handler for the IRC PART command.
property OnCommandPart: TIdIrcOneParmEvent;
Parameters
Parm
List of channels.
Thread
Client generating the event.
Description
OnCommandPart is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC PART command. PART is used to signal that the client should be removed from the list of active users for all channels in Parm. Parm can contain a comma-delimited list of channel names, or a single channel name.

TIdIRCServer.OnCommandPass
TIdIRCServer
Event handler for the IRC PASS command.
property OnCommandPass: TIdIrcOneParmEvent;
Parameters
Parm
Password for the connection.
Thread
Client generating the event.
Description
OnCommandPass is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC PASS command. PASS is used to set the password to be used for a connection.

TIdIRCServer.OnCommandPing
TIdIRCServer
Event handler for the IRC PING command.
property OnCommandPing: TIdIrcTwoParmEvent;
Parameters
Parm1
Server issuing the PING request.
Parm2
Server where a PONG response shall be forwarded.
Thread
Client generating the event.
Description
OnCommandPing is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC PING command. PING is used to test for the presence of an active client at the other end of the connection. A PING message is sent at regular intervals if no other activity detected coming from a connection. If a connection fails to respond to a PING command within a set amount of time, that connection is closed.

Parm1 is the name of the server where a client PONG response must be sent, and normally represents the server that issued the PING request.

Parm2 is an optional parameter that contains the name of a server where a client PONG response should be forwarded.


TIdIRCServer.OnCommandPong
TIdIRCServer
Event handler for the IRC PONG command.
property OnCommandPong: TIdIrcTwoParmEvent;
Parameters
Parm1
Server responding to the PING message.
Parm2
Server where the PONG message shall be forwarded.
Thread
Client generating the event.
Description
OnCommandPong is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC PONG command. PONG is used to reply to a PING message.

TIdIRCServer.OnCommandPrivMsg
TIdIRCServer
Event handler for the IRC PRIVMSG command.
property OnCommandPrivMsg: TIdIrcTwoParmEvent;
Parameters
Parm1
List of receivers.
Parm2
Message to be sent to the receivers.
Thread
Client generating the event.
Description
OnCommandPrivMsg is a TIdIrcTwoParmEvent event handler that allows the server to response to the IRC PRIVMSG command. PRIVMSG is used to send private messages between users.

Parm1 contains a nickname, a comma-delimited list of nicknames or channels, or a host/server mask that identifies the destination for the message in Parm2.


TIdIRCServer.OnCommandQuit
TIdIRCServer
Event handler for the IRC QUIT command.
property OnCommandQuit: TIdIrcOneParmEvent;
Parameters
Parm
Text to send in the QUIT message.
Thread
Client generating the event.
Description
OnCommandQuit is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC QUIT command. QUIT is used to end a client session with an optional text message. The server must close the connection to a client which sends a QUIT message.

If Parm is not specified, the NickName is sent as the test for the message. When two server connections are involved, the text for the message is the space-delimited names of the servers.


TIdIRCServer.OnCommandRehash
TIdIRCServer
Event handler for the IRC REHASH command.
property OnCommandRehash: TIdIrcGetEvent;
Parameters
Thread
Client generating the event.
Description
OnCommandRehash is a TIdIrcGetEvent event handler that allows the server to respond to the IRC REHASH command. REHASH is used by the operator to force the server to re-read and process its configuration file.

TIdIRCServer.OnCommandRestart
TIdIRCServer
Event handler for the IRC RESTART command.
property OnCommandRestart: TIdIrcGetEvent;
Parameters
Thread
Client generating the event.
Description
OnCommandRestart is a TIdIrcGetEvent event handler that allows the server to respond to the IRC RESTART command. RESTART is used to force a server to restart.

RESTART is optional since it may be viewed as a risk to allow arbitrary people to connect to a server as an operator and execute this command, causing (at least) a disruption to service.

The RESTART command must always be fully processed by the server to which the sending client is connected and not be passed onto other connected servers.


TIdIRCServer.OnCommandServer
TIdIRCServer
Event handler for the IRC SERVER command.
property OnCommandServer: TIdIrcServerEvent;
Parameters
Hopcount
Number of hops to the server.
Info
Host name for the server connection.
ServerName
Name of the new server connection.
Thread
Client generating the event.
Description
OnCommandServer is a TIdIrcServerEvent event handler that allows the server to respond to the IRC SERVER command. SERVER is used to tell a server that the other end of a new connection is a server. This message is also used to pass server data over whole net. When a new server is connected to net, information about it be broadcast to the whole network.

HopCount is used to give all servers some internal information on how far away all servers are. With a full server list, it would be possible to construct a map of the entire server tree, but hostmasks prevent this from being done.

If a SERVER message is parsed and attempts to introduce a server which is already known to the receiving server, the connection from which that message must be closed (following the correct procedures), since a duplicate route to a server has formed and the acyclic nature of the IRC tree broken.


TIdIRCServer.OnCommandSQuit
TIdIRCServer
Event handler for the IRC SQUIT command.
property OnCommandSQuit: TIdIrcTwoParmEvent;
Parameters
Parm1
Server name for the message.
Parm2
Comment for the message.
Thread
Client generating the event.
Description
OnCommandSQuit is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC SQUIT command. SQUIT is used to send a notification that a server is stopping or has ceased to function. If a server wishes to break the connection to another server it must send a SQUIT message to the other server, using the name of the other server as the server parameter, which then closes its connection to the quitting server.

This command is also available operators to help keep a network of IRC servers connected in an orderly fashion. Operators may also issue an SQUIT message for a remote server connection. In this case, the SQUIT must be parsed by each server in between the operator and the remote server, updating the view of the network held by each server as explained below.

Parm2 should be supplied by all operators who execute a SQUIT for a remote server (that is not connected to the server they are currently on) so that other operators are aware for the reason of this action. Parm2 is also filled in by servers which may place an error or similar message here.

Both of the servers which are on either side of the connection being closed are required to send out a SQUIT message (to all its other server connections) for all other servers which are considered to be behind that link.

Similarly, a QUIT message must be sent to the other connected servers rest of the network on behalf of all clients behind that link. In addition to this, all channel members of a channel which lost a member due to the split must be sent a QUIT message.

If a server connection is terminated prematurely (e.g. the server on the other end of the link died), the server which detects this disconnection is required to inform the rest of the network that the connection has closed and fill in the comment field with something appropriate.


TIdIRCServer.OnCommandStats
TIdIRCServer
Event handler for the IRC STATS command.
property OnCommandStats: TIdIrcTwoParmEvent;
Parameters
Parm1
Statistics query for the server.
Parm2
Server to be queried.
Thread
Client generating the event.
Description
OnCommandStats is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC STATS command. STATS is used to query statistics for the server specified in Parm1 using the query in Parm1.

If Parm2 is omitted, only the end of stats reply is sent back. The implementation of this command is highly dependent on the server which replies, although the server must be able to supply information as described by the queries below (or similar).

A query may be given by any single letter which is only checked by the destination server (if given as the Parm2 parameter) and is otherwise passed on by intermediate servers, ignored and unaltered.

The following queries are those found in the current IRC implementation and provide a large portion of the setup information for that server. Although these may not be supported in the same way by other versions, all servers should be able to supply a valid reply to a STATS query which is consistent with the reply formats currently used and the purpose of the query.

The currently supported queries are:

  • c - returns a list of servers which the server may connect to or allow connections from.

  • h - returns a list of servers which are either forced to be treated as leaves or allowed to act as hubs.

  • i - returns a list of hosts which the server allows a client to connect from.

  • k - returns a list of banned username/hostname combinations for that server.

  • l - returns a list of the server's connections, showing how long each connection has been established and the traffic over that connection in bytes and messages for each direction.

  • m - returns a list of commands supported by the server and the usage count for each if the usage count is non zero.

  • o - returns a list of hosts from which normal clients may become operators.

  • y - show Y (Class) lines from server's configuration file.

  • u - returns a string showing how long the server has been up.

TIdIRCServer.OnCommandSummon
TIdIRCServer
Event handler for the IRC SUMMON command.
property OnCommandSummon: TIdIrcTwoParmEvent;
Parameters
Parm1
User name to receive the message.
Parm2
Server name to receive the message.
Thread
Client generating the event.
Description
OnCommandSummon is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC SUMMON command. SUMMON is used to ask a user on a host running an IRC server to join an IRC network. The SUMMON message is only sent if the target server has SUMMON enabled, the user is logged in and the server process can write to the user session.

If Parm2 is given, this is the target server for the message. If summon is not enabled in a server, it must return the ERR_SUMMONDISABLED numeric and pass the summon message to other IRC servers.


TIdIRCServer.OnCommandTime
TIdIRCServer
Event handler for the IRC TIME command.
property OnCommandTime: TIdIrcOneParmEvent;
Parameters
Parm
Server used to retrieve the time.
Thread
Client generating the event.
Description
OnCommandTime is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC TIME command. TIME is used to query the time for the server specified in Parm. If Parm is not given, the server handling the command must reply to the query.

TIdIRCServer.OnCommandTopic
TIdIRCServer
Event handler for the IRC TOPIC command.
property OnCommandTopic: TIdIrcTwoParmEvent;
Parameters
Parm1
Channel name.
Parm2
Topic for the Channel.
Thread
Client generating the event.
Description
OnCommandTopic is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC TOPIC command. TOPIC is used to change or view the topic for a channel.

Parm1 is the channel to be affected by the message.

Parm2 is the topic for the specified channel.

If Parm2 is not specified, the current topic for Parm1 will be retrieved.


TIdIRCServer.OnCommandTrace
TIdIRCServer
Event handler for the IRC TRACE command.
property OnCommandTrace: TIdIrcOneParmEvent;
Parameters
Parm
Server name for the trace.
Thread
Client generating the event.
Description
OnCommandTrace is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC TRACE command. TRACE is used to find the route to the server specified in Parm.

Each server that processes this message must tell the sender about it by sending a reply indicating it is a pass-through link, forming a chain of replies similar to that gained from using "traceroute". After sending this reply back, it must then send the TRACE message to the next server until given server is reached. If Parm is omitted, it is recommended that TRACE command send a message to the sender telling which servers the current server has direct connection to.


TIdIRCServer.OnCommandUser
TIdIRCServer
Event handler for the IRC USER command.
property OnCommandUser: TIdIrcUserEvent;
Parameters
HostName
Host name for the connection.
RealName
Real name for the connection.
ServerName
Server name for the connection.
Thread
Client generating the event.
UserName
User name for the connection.
Description
OnCommandUser is a TIdIrcUserEvent event handler that allows the server to respond to the IRC USER command. USER is used to specify the username, hostname, servername and realname of a new user. It is also used in communication between servers to indicate new user arriving on IRC, since only after both USER and NICK have been received from a client does a user become registered.

USER messages between IRC servers must to be prefixed with client's NICKname. Note that hostname and servername are normally ignored by the IRC server when the USER command comes from a directly connected client (for security reasons), but they are used in server to server communication. This means that a NICK must always be sent to a remote server when a new user is being introduced to the rest of the network before the accompanying USER is sent.

It must be noted that realname parameter must be the last parameter, because it may contain space characters and must be prefixed with a colon (':') to make sure this is recognized as such.

Since it is easy for a client to lie about its username by relying solely on the USER message, the use of an "Identity Server" is recommended. If the host which a user connects from has such a server enabled the username is set to that as in the reply from the "Identity Server".


TIdIRCServer.OnCommandUserHost
TIdIRCServer
Event handler for the IRC USERHOST command.
property OnCommandUserHost: TIdIrcOneParmEvent;
Parameters
Parm
List of nicknames.
Thread
Client generating the event.
Description
OnCommandUserHost is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC USERHOST command. USERHOST is used to retrieve a list of information about each nickname that it found. The returned list has each reply separated by a space.

TIdIRCServer.OnCommandUsers
TIdIRCServer
Event handler for the IRC USERS command.
property OnCommandUsers: TIdIrcOneParmEvent;
Parameters
Parm
Server name.
Thread
Client generating the event.
Description
OnCommandUsers is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC USERS command. USERS is used to return a list of users logged into the server in a similar format to who(1), rusers(1) and finger(1). Some people may disable this command on their server for security related reasons. If disabled, the correct numeric response must be returned to indicate this condition.

TIdIRCServer.OnCommandVersion
TIdIRCServer
Event handler for the IRC VERSION command.
property OnCommandVersion: TIdIrcOneParmEvent;
Parameters
Parm
Server name.
Thread
Client generating the event.
Description
OnCommandVersion is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC VERSION command. VERSION is used to query the version of the server program. The optional parameter Parm is used to query the version of the server program which a client is not directly connected to.

TIdIRCServer.OnCommandWallops
TIdIRCServer
Event handler for the IRC WALLOPS command.
property OnCommandWallops: TIdIrcOneParmEvent;
Parameters
Parm
Text to send to all operators.
Thread
Client generating the event.
Description
OnCommandWallops is a TIdIrcOneParmEvent event handler that allows the server to respond to the IRC WALLOPS command. WALLOPS is used to send a message to all operators currently online. After implementing WALLOPS as a user command it was found that it was often and commonly abused as a means of sending a message to a lot of people (much similar to WALL). Due to this it is recommended that the current implementation of WALLOPS be used as an example by allowing and recognizing only servers as the senders of WALLOPS.

TIdIRCServer.OnCommandWho
TIdIRCServer
Event handler for the IRC WHO command.
property OnCommandWho: TIdIrcTwoParmEvent;
Parameters
Parm1
User name, or an empty string.
Parm2
Constant value for operators.
Thread
Client generating the event.
Description
OnCommandWho is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC WHO command. WHO is used to return a list of information which 'matches' the Parm1 parameter.

In the absence of the Parm1 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 Parm1 of "0" or any wildcard which will end up matching every entry possible.

The Parm1 passed to WHO is matched against users' host, server, real name and nickname if the channel Parm1 cannot be found.

If the "o" parameter is passed only operators are returned according to the name mask supplied.


TIdIRCServer.OnCommandWhoIs
TIdIRCServer
Event handler for the IRC WHOIS command.
property OnCommandWhoIs: TIdIrcTwoParmEvent;
Parameters
Parm1
Server name.
Parm2
Nickname mask list.
Thread
Client generating the event.
Description
OnCommandWhoIs is a TIdIrcTwoParmEvent event handler that allows the server to respond to the IRC WHOIS command. WHOIS is used to query information about users. The server will answer this message with several numeric messages indicating different statuses of each user which matches the nickmask (if you are entitled to see them). If no wildcard is present in the Parm2 any information about that nick which you are allowed to see is presented. A comma (',') separated list of nicknames may be given.

The latter version sends the query to a specific server. It is useful if you want to know how long the user in question has been idle as only local server (ie. the server the user is directly connected to) knows that information, while everything else is globally known.


TIdIRCServer.OnCommandWhoWas
TIdIRCServer
Event handler for the IRC WHOWAS command.
property OnCommandWhoWas: TIdIrcThreeParmEvent;
Parameters
Parm1
Previous Nickname.
Parm2
Maximum number of replies from the server.
Parm3
Server to search for the Nickname history.
Thread
Client generating the event.
Description
OnCommandWhoWas is a TIdIrcThreeParmEvent event handler that allows the server to respond to the IRC WHOWAS command. WHOWAS is used to retrieve information about a nickname which no longer exists. This may either be due to a nickname change or the user leaving IRC.

In response to this query, the server searches through its nickname history, looking for any nicks which are lexically the same (no wild card matching here). The history is searched backward, returning the most recent entry first. If there are multiple entries, up to Parm2 replies will be returned (or all of them if no Parm2 parameter is given). If a non-positive number is passed as being Parm2, then a full search is done.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.