Fix some ugly logic.

Change-Id: I8f0beb454bf2cac24549015887df799e89f033cd
Reviewed-on: http://gerrit.dmdirc.com/2951
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>