|
| 1 | +Client Capab Proposal (v5) |
| 2 | +Authors: fl and Beeth |
| 3 | +-------------------------- |
| 4 | + |
| 5 | + |
| 6 | +This document aims to define a protocol for capabilities between a server |
| 7 | +and a client. These capabs help servers introduce changes to the protocol |
| 8 | +that could cause problems with clients that do not support the changes. |
| 9 | + |
| 10 | +This specification defines the "CAP" command, and the available subcommands. |
| 11 | +This is sent in the form: |
| 12 | + CAP [subcommand [parameters]] |
| 13 | + |
| 14 | +CAP |
| 15 | +--- |
| 16 | + |
| 17 | +A client that supports this specification must send one of three things at |
| 18 | +the earliest stage of registration. To enter capab negotiation it can either |
| 19 | +send the command "CAP" without parameters to request a list of capabs, or it |
| 20 | +can send the subcommand "REQ" to request capabs without first seeing the |
| 21 | +list of available capabs. A client which does not wish to enter capab |
| 22 | +negotiation but supports this spec must send the subcommand "END" to notify |
| 23 | +support of the specification. |
| 24 | + |
| 25 | +The "CAP" command may be used at any time during the connection to request a |
| 26 | +list of capabs. If the user enters capab negotiation the server must |
| 27 | +postpone registration until the client issues the subcommand "END". |
| 28 | + |
| 29 | +A server receiving the parameterless "CAP" command from a client must reply |
| 30 | +to this command with a list of capabs supported by the server using the "LS" |
| 31 | +and "LSL" subcommands. The "LS" subcommand is used when the capab list must |
| 32 | +be spread across multiple lines and is used for all except the last line. |
| 33 | +The subcommand "LSL" is used to finish the list of capabs. |
| 34 | + |
| 35 | +The subcommands "LS" and "LSL" are sent in the form: |
| 36 | + CAP <subcommand> :<capab> [capab]* |
| 37 | + |
| 38 | +CAP: REQ |
| 39 | +-------- |
| 40 | + |
| 41 | +The "REQ" subcommand is used by a client to give a list of capabs it |
| 42 | +wishes to use. |
| 43 | + |
| 44 | +The subcommand "REQ" is sent in the form: |
| 45 | + CAP REQ :<capab> [capab]* |
| 46 | + |
| 47 | +If any of the requested capabs are prefixed with '-' then the client is |
| 48 | +notifying the server that it wishes the specified capab to be disabled for |
| 49 | +the client. |
| 50 | + |
| 51 | +The responsibility is placed on the client to request a valid list of capabs. |
| 52 | +The server must either accept the request as issued or reject it. A server |
| 53 | +must not partially accept parameters of the subcommand "REQ". |
| 54 | + |
| 55 | +CAP: ACK |
| 56 | +-------- |
| 57 | + |
| 58 | +The "ACK" subcommand is used by a server to acknowledge that the |
| 59 | +given capabilities are now being used. The "ACK" subcommand is used by a |
| 60 | +client to acknowledge the given capabilities are now being used. |
| 61 | + |
| 62 | +The server places the capabilities it is acknowledging as parameters. The |
| 63 | +parameters of the subcommand "ACK" will be identical to the parameters issued |
| 64 | +in the subcommand "REQ" from the client if the request is valid. If any of |
| 65 | +the requested capabs modify the protocol stream, after sending the subcommand |
| 66 | +"ACK" the server must then transmit any following messages in the modified |
| 67 | +protocol stream form. |
| 68 | + |
| 69 | +The client must issue the subcommand "ACK" for any capabilities that modify |
| 70 | +the protocol stream, using the capabs that modify the protocol stream as the |
| 71 | +subcommand "ACK" parameters. A client must know which capabs modify the |
| 72 | +protocol stream and send the subcommand "ACK" before transmitting any |
| 73 | +messages in the modified protocol stream. A client must not issue the |
| 74 | +subcommand "ACK" for a capab without first receiving the subcommand "ACK" |
| 75 | +containing that capab from the server. |
| 76 | + |
| 77 | +A client must not issue the subcommand "ACK" for capabs that do not modify |
| 78 | +the protocol stream. |
| 79 | + |
| 80 | +The subcommand "ACK" is sent in the following form: |
| 81 | + CAP ACK :<capab> [capab]* |
| 82 | + |
| 83 | +CAP: NAK |
| 84 | +-------- |
| 85 | + |
| 86 | +The "NAK" subcommand is used by a server to notify a client that the |
| 87 | +requested list of capabs are invalid. |
| 88 | + |
| 89 | +A client receiving the subcommand "NAK" must request again the capabs it |
| 90 | +wishes to use. The parameters of the subcommand "NAK" will be identical |
| 91 | +to the parameters issued in the subcommand "REQ" from the client if the |
| 92 | +request is invalid. |
| 93 | + |
| 94 | +The subcommand "NAK" is sent in the following form: |
| 95 | + CAP NAK :<capab> [capab]* |
| 96 | + |
| 97 | +CAP: CLEAR |
| 98 | +---------- |
| 99 | + |
| 100 | +The "CLEAR" subcommand is used by a server to notify a client that all |
| 101 | +capabs have been cleared. The "CLEAR" subcommand is used by a client to |
| 102 | +request that a server clears its current capab list. |
| 103 | + |
| 104 | +A server receiving the subcommand "CLEAR" must issue back the subcommand |
| 105 | +"CLEAR" using the current protocol stream. It must then clear the stored |
| 106 | +list of capabs and revert to receiving/sending a 'normal' protocol stream |
| 107 | +from/to the client. |
| 108 | + |
| 109 | +A client receiving the subcommand "CLEAR" must then revert to expecting to |
| 110 | +receive a 'normal' protocol stream. |
| 111 | + |
| 112 | +The subcommand "CLEAR" is sent in the form: |
| 113 | + CAP CLEAR |
| 114 | + |
| 115 | +CAP: END |
| 116 | +-------- |
| 117 | + |
| 118 | +The "END" subcommand is used by a client to notify the server it has |
| 119 | +finished capab negotiation and the server can proceed with registration. |
| 120 | + |
| 121 | +The subcommand "END" is sent in the form: |
| 122 | + CAP END |
| 123 | + |
| 124 | + |
| 125 | +Examples |
| 126 | +-------- |
| 127 | + |
| 128 | +CLIENT: indicates what client sends |
| 129 | +SERVER: indicates what server sends |
| 130 | + |
| 131 | +This example shows a client which doesnt support this specification: |
| 132 | + |
| 133 | +CLIENT: NICK FOO |
| 134 | +CLIENT: USER FOO FOO FOO FOO |
| 135 | +SERVER: :SERVERNAME 001 ... |
| 136 | + |
| 137 | +This example shows a client supporting this specification but not |
| 138 | +wishing to use capabs for the connection: |
| 139 | + |
| 140 | +CLIENT: CAP END |
| 141 | +CLIENT: PASS FOO |
| 142 | +CLIENT: NICK FOO |
| 143 | +CLIENT: USER FOO FOO FOO FOO |
| 144 | +SERVER: :SERVERNAME 001 .... |
| 145 | + |
| 146 | +This example shows a client requesting a list of capabs then successfully |
| 147 | +requesting the capabs. |
| 148 | + |
| 149 | +CLIENT: CAP |
| 150 | +CLIENT: NICK FOO |
| 151 | +CLIENT: USER FOO FOO FOO FOO |
| 152 | +SERVER: CAP LS :A B C D E F G H |
| 153 | +SERVER: CAP LSL :I J |
| 154 | +CLIENT: CAP REQ :A B C D E F |
| 155 | +SERVER: CAP ACK :A B C D E F |
| 156 | +CLIENT: CAP END |
| 157 | +SERVER: :SERVERNAME 001 ... |
| 158 | + |
| 159 | +This example shows a client requesting an invalid list of capabs. |
| 160 | + |
| 161 | +CLIENT: CAP |
| 162 | +CLIENT: NICK FOO |
| 163 | +CLIENT: USER FOO FOO FOO FOO |
| 164 | +SERVER: CAP LSL :A B C D E F G H |
| 165 | +CLIENT: CAP REQ :A B |
| 166 | +SERVER: CAP NAK :A B |
| 167 | +CLIENT: CAP REQ :A |
| 168 | +SERVER: CAP ACK :A |
| 169 | +CLIENT: CAP REQ :C |
| 170 | +SERVER: CAP ACK :C |
| 171 | +CLIENT: CAP END |
| 172 | +SERVER: :SERVERNAME 001 ... |
0 commit comments