📄 rfc2811.txt
字号:
m - toggle the moderated channel;
n - toggle the no messages to channel from clients on the
outside;
q - toggle the quiet channel flag;
p - toggle the private channel flag;
s - toggle the secret channel flag;
r - toggle the server reop channel flag;
t - toggle the topic settable by channel operator only flag;
k - set/remove the channel key (password);
l - set/remove the user limit to channel;
b - set/remove ban mask to keep users out;
e - set/remove an exception mask to override a ban mask;
I - set/remove an invitation mask to automatically override
the invite-only flag;
Unless mentioned otherwise below, all these modes can be manipulated
by "channel operators" by using the MODE command defined in "IRC
Client Protocol" [IRC-CLIENT].
4.1 Member Status
The modes in this category take a channel member nickname as argument
and affect the privileges given to this user.
4.1.1 "Channel Creator" Status
The mode 'O' is only used in conjunction with "safe channels" and
SHALL NOT be manipulated by users. Servers use it to give the user
creating the channel the status of "channel creator".
Kalt Informational [Page 7]
RFC 2811 Internet Relay Chat: Channel Management April 2000
4.1.2 Channel Operator Status
The mode 'o' is used to toggle the operator status of a channel
member.
4.1.3 Voice Privilege
The mode 'v' is used to give and take voice privilege to/from a
channel member. Users with this privilege can talk on moderated
channels. (See section 4.2.3 (Moderated Channel Flag).
4.2 Channel Flags
The modes in this category are used to define properties which
affects how channels operate.
4.2.1 Anonymous Flag
The channel flag 'a' defines an anonymous channel. This means that
when a message sent to the channel is sent by the server to users,
and the origin is a user, then it MUST be masked. To mask the
message, the origin is changed to "anonymous!anonymous@anonymous."
(e.g., a user with the nickname "anonymous", the username "anonymous"
and from a host called "anonymous."). Because of this, servers MUST
forbid users from using the nickname "anonymous". Servers MUST also
NOT send QUIT messages for users leaving such channels to the other
channel members but generate a PART message instead.
On channels with the character '&' as prefix, this flag MAY be
toggled by channel operators, but on channels with the character '!'
as prefix, this flag can be set (but SHALL NOT be unset) by the
"channel creator" only. This flag MUST NOT be made available on
other types of channels.
Replies to the WHOIS, WHO and NAMES commands MUST NOT reveal the
presence of other users on channels for which the anonymous flag is
set.
4.2.2 Invite Only Flag
When the channel flag 'i' is set, new members are only accepted if
their mask matches Invite-list (See section 4.3.2) or they have been
invited by a channel operator. This flag also restricts the usage of
the INVITE command (See "IRC Client Protocol" [IRC-CLIENT]) to
channel operators.
Kalt Informational [Page 8]
RFC 2811 Internet Relay Chat: Channel Management April 2000
4.2.3 Moderated Channel Flag
The channel flag 'm' is used to control who may speak on a channel.
When it is set, only channel operators, and members who have been
given the voice privilege may send messages to the channel.
This flag only affects users.
4.2.4 No Messages To Channel From Clients On The Outside
When the channel flag 'n' is set, only channel members MAY send
messages to the channel.
This flag only affects users.
4.2.5 Quiet Channel
The channel flag 'q' is for use by servers only. When set, it
restricts the type of data sent to users about the channel
operations: other user joins, parts and nick changes are not sent.
From a user's point of view, the channel contains only one user.
This is typically used to create special local channels on which the
server sends notices related to its operations. This was used as a
more efficient and flexible way to replace the user mode 's' defined
in RFC 1459 [IRC].
4.2.6 Private and Secret Channels
The channel flag 'p' is used to mark a channel "private" and the
channel flag 's' to mark a channel "secret". Both properties are
similar and conceal the existence of the channel from other users.
This means that there is no way of getting this channel's name from
the server without being a member. In other words, these channels
MUST be omitted from replies to queries like the WHOIS command.
When a channel is "secret", in addition to the restriction above, the
server will act as if the channel does not exist for queries like the
TOPIC, LIST, NAMES commands. Note that there is one exception to
this rule: servers will correctly reply to the MODE command.
Finally, secret channels are not accounted for in the reply to the
LUSERS command (See "Internet Relay Chat: Client Protocol" [IRC-
CLIENT]) when the <mask> parameter is specified.
Kalt Informational [Page 9]
RFC 2811 Internet Relay Chat: Channel Management April 2000
The channel flags 'p' and 's' MUST NOT both be set at the same time.
If a MODE message originating from a server sets the flag 'p' and the
flag 's' is already set for the channel, the change is silently
ignored. This should only happen during a split healing phase
(mentioned in the "IRC Server Protocol" document [IRC-SERVER]).
4.2.7 Server Reop Flag
The channel flag 'r' is only available on channels which name begins
with the character '!' and MAY only be toggled by the "channel
creator".
This flag is used to prevent a channel from having no channel
operator for an extended period of time. When this flag is set, any
channel that has lost all its channel operators for longer than the
"reop delay" period triggers a mechanism in servers to reop some or
all of the channel inhabitants. This mechanism is described more in
detail in section 5.2.4 (Channel Reop Mechanism).
4.2.8 Topic
The channel flag 't' is used to restrict the usage of the TOPIC
command to channel operators.
4.2.9 User Limit
A user limit may be set on channels by using the channel flag 'l'.
When the limit is reached, servers MUST forbid their local users to
join the channel.
The value of the limit MUST only be made available to the channel
members in the reply sent by the server to a MODE query.
4.2.10 Channel Key
When a channel key is set (by using the mode 'k'), servers MUST
reject their local users request to join the channel unless this key
is given.
The channel key MUST only be made visible to the channel members in
the reply sent by the server to a MODE query.
4.3 Channel Access Control
The last category of modes is used to control access to the channel,
they take a mask as argument.
Kalt Informational [Page 10]
RFC 2811 Internet Relay Chat: Channel Management April 2000
In order to reduce the size of the global database for control access
modes set for channels, servers MAY put a maximum limit on the number
of such modes set for a particular channel. If such restriction is
imposed, it MUST only affect user requests. The limit SHOULD be
homogeneous on a per IRC network basis.
4.3.1 Channel Ban and Exception
When a user requests to join a channel, his local server checks if
the user's address matches any of the ban masks set for the channel.
If a match is found, the user request is denied unless the address
also matches an exception mask set for the channel.
Servers MUST NOT allow a channel member who is banned from the
channel to speak on the channel, unless this member is a channel
operator or has voice privilege. (See Section 4.1.3 (Voice
Privilege)).
A user who is banned from a channel and who carries an invitation
sent by a channel operator is allowed to join the channel.
4.3.2 Channel Invitation
For channels which have the invite-only flag set (See Section 4.2.2
(Invite Only Flag)), users whose address matches an invitation mask
set for the channel are allowed to join the channel without any
invitation.
5. Current Implementations
The only current implementation of these rules as part of the IRC
protocol is the IRC server, version 2.10.
The rest of this section deals with issues that are mostly of
importance to those who wish to implement a server but some parts may
also be of interest for client writers.
5.1 Tracking Recently Used Channels
This mechanism is commonly known as "Channel Delay" and generally
only applies to channels which names is prefixed with the character
'#' (See Section 3.1 "Standard channels").
When a network split occurs, servers SHOULD keep track of which
channels lost a "channel operator" as the result of the break. These
channels are then in a special state which lasts for a certain period
of time. In this particular state, the channels cannot cease to
Kalt Informational [Page 11]
RFC 2811 Internet Relay Chat: Channel Management April 2000
exist. If all the channel members leave the channel, the channel
becomes unavailable: the server local clients cannot join the channel
as long as it is empty.
Once a channel is unavailable, it will become available again either
because a remote user has joined the channel (most likely because the
network is healing), or because the delay period has expired (in
which case the channel ceases to exist and may be re-created).
The duration for which a channel death is delayed SHOULD be set
considering many factors among which are the size (user wise) of the
IRC network, and the usual duration of network splits. It SHOULD be
uniform on all servers for a given IRC network.
5.2 Safe Channels
This document introduces the notion of "safe channels". These
channels have a name prefixed with the character '!' and great effort
is made to avoid collisions in this name space. Collisions are not
impossible, however they are very unlikely.
5.2.1 Channel Identifier
The channel identifier is a function of the time. The current time
(as defined under UNIX by the number of seconds elapsed since
00:00:00 GMT, January 1, 1970) is converted in a string of five (5)
characters using the following base:
"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890" (each character has a decimal
value starting from 0 for 'A' to 35 for '0').
The channel identifier therefore has a periodicity of 36^5 seconds
(about 700 days).
5.2.2 Channel Delay
These channels MUST be subject to the "channel delay" mechanism
described in section 5.1 (Channel Delay). However, the mechanism is
slightly adapted to fit better.
Servers MUST keep track of all such channels which lose members as
the result of a network split, no matter whether the user is a
"channel operator" or not.
However, these channels do NOT ever become unavailable, it is always
possible to join them even when they are empty.
Kalt Informational [Page 12]
RFC 2811 Internet Relay Chat: Channel Management April 2000
5.2.3 Abuse Window
Because the periodicity is so long, attacks on a particular channel
(name) may only occur once in a very long while. However, with luck
and patience, it is still possible for a user to cause a channel
collision. In order to avoid this, servers MUST "look in the future"
and keep a list of channel names which identifier is about to be used
(in the coming few days for example). Such list should remain small,
not be a burden for servers to maintain and be used to avoid channel
collisions by preventing the re-creation of such channel for a longer
period of time than channel delay does.
Eventually a server MAY choose to extend this procedure to forbid
creation of channels with the same shortname only (then ignoring the
channel identifier).
5.2.4 Preserving Sanity In The Name Space
The combination of the mechanisms described in sections 5.2.2 and
5.2.3 makes it quite difficult for a user to create a channel
collision. However, another type of abuse consists of creating many
channels having the same shortname, but different identifiers. To
prevent this from happening, servers MUST forbid the creation of a
new channel which has the same shortname of a channel currently
existing.
5.2.5 Server Reop Mechanism
When a channel has been opless for longer than the "reop delay"
period and has the channel flag 'r' set (See Section 4.2.7 (Server
Reop Flag)), IRC servers are responsible for giving the channel
operator status randomly to some of the members.
The exact logic used for this mechanism by the current implementation
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -