def doCapNew(self, msg):
        if len(msg.args) != 3:
            log.warning('Bad CAP NEW from server: %r', msg)
            return
        caps = msg.args[2].split()
        assert caps, 'Empty list of capabilities'
        self._addCapabilities(msg.args[2])
        if not self.sasl_authenticated and 'sasl' in self.state.capabilities_ls:
            self.resetSasl()
            s = self.state.capabilities_ls['sasl']
            if s is not None:
                self.filterSaslMechanisms(set(s.split(',')))
        common_supported_unrequested_capabilities = (
                set(self.state.capabilities_ls) &
                self.REQUEST_CAPABILITIES -
                self.state.capabilities_ack)
        if common_supported_unrequested_capabilities:
            caps = ' '.join(sorted(common_supported_unrequested_capabilities))
            self.sendMsg(ircmsgs.IrcMsg(command='CAP',
                args=('REQ', caps)))
dataset/ETHPy150Open ProgVal/Limnoria/src/irclib.py/Irc.doCapNew/original