+/*
+ * RFC 2812, (3.2.1 Join message Command):
+ * Note that this message
+ * accepts a special argument ("0"), which is a special request to leave all
+ * channels the user is currently a member of. The server will process this
+ * message as if the user had sent a PART command (See Section 3.2.2) for
+ * each channel he is a member of.
+ */
+static bool
+part_from_all_channels(CLIENT* client, CLIENT *target)
+{
+ CL2CHAN *cl2chan = Channel_FirstChannelOf(target);
+ CHANNEL *chan;
+
+ while (cl2chan) {
+ chan = Channel_GetChannel(cl2chan);
+ assert( chan != NULL );
+ Channel_Part(target, client, Channel_Name(chan), Client_ID(target));
+
+ /* next */
+ cl2chan = Channel_FirstChannelOf(target);
+ }
+ return CONNECTED;
+}
+
+