Modify PING/PONG and reconnection logic to use essentially the same sequence as Quassel.  Ping every 30 seconds of inactivity.  Reset the time-since-last-ping counter on any input from the server.  Ping out after 180 seconds of no input from server.  Increment to next server on connection failure or ERROR.