def addMsg(self, irc, msg):
        """Updates the state based on the irc object and the message."""
        self.history.append(msg)
        if ircutils.isUserHostmask(msg.prefix) and not msg.command == 'NICK':
            self.nicksToHostmasks[msg.nick] = msg.prefix
        if msg.server_tags in 'batch':
            batch = msg.server_tags['batch']
            assert batch in self.batches, \
                    'Server references undeclared batch %s' % batch
            self.batches[batch].messages.append(msg)
        method = self.dispatchCommand(msg.command)
        if method is not None:
            method(irc, msg)
dataset/ETHPy150Open ProgVal/Limnoria/src/irclib.py/IrcState.addMsg/swapped operands of `in`