'Parse a server mode change message.'

def irc_MODE(self, user, params):

    (channel, modes, args) = (params[0], params[1], params[2:])
    if (modes[0] not in '-+'):
        modes = ('+' + modes)
    if (channel == self.nickname):
        paramModes = self.getUserModeParams()
    else:
        paramModes = self.getChannelModeParams()
    try:
        (added, removed) = parseModes(modes, args, paramModes)
    except IRCBadModes:
        log.err(None, ('An    error    occurred    while    parsing    the    following    MODE    message:    MODE    %s' % ('    '.join(params),)))
    else:
        if added:
            (modes, params) = zip(*added)
            self.modeChanged(user, channel, True, ''.join(modes), params)
        if removed:
            (modes, params) = zip(*removed)
            self.modeChanged(user, channel, False, ''.join(modes), params)
