|
@@ -1161,9 +1161,16 @@ func isonHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
|
1161
|
1161
|
|
1162
|
1162
|
// JOIN <channel>{,<channel>} [<key>{,<key>}]
|
1163
|
1163
|
func joinHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *ResponseBuffer) bool {
|
1164
|
|
- // kill JOIN 0 requests
|
|
1164
|
+ // #1417: allow `JOIN 0` with a confirmation code
|
1165
|
1165
|
if msg.Params[0] == "0" {
|
1166
|
|
- rb.Notice(client.t("JOIN 0 is not allowed"))
|
|
1166
|
+ expectedCode := utils.ConfirmationCode("", rb.session.ctime)
|
|
1167
|
+ if len(msg.Params) == 1 || msg.Params[1] != expectedCode {
|
|
1168
|
+ rb.Notice(fmt.Sprintf(client.t("Warning: /JOIN 0 will remove you from all channels. To confirm, type: /JOIN 0 %s"), expectedCode))
|
|
1169
|
+ } else {
|
|
1170
|
+ for _, channel := range client.Channels() {
|
|
1171
|
+ channel.Part(client, "", rb)
|
|
1172
|
+ }
|
|
1173
|
+ }
|
1167
|
1174
|
return false
|
1168
|
1175
|
}
|
1169
|
1176
|
|