Correct me if I'm wrong, but DH key exchange on its own cannot prevent MITM attacks. A MITM would simply exchange keys separately with you and your friend. So while you can be sure that you've established a secure channel with somebody, you can't be sure who that somebody is. In other words, some form of authentication is necessary, which DH does not provide.

Asymmetric (public key) cryptography could be used instead of DH for key exchange (if not for the entire communication) but this assumes that you know with certainty that a particular public key belongs to a particular person (your friend). In other words, some sort of secure out-of-band (outside of IRC) communication seems necessary.

/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com