public static String makeDisconnectReason(int reason,String reasonMessage){
  String result="";
switch (reason) {
case Irc.ERROR_UNKNOWN_HOST:
    result="Unknown host";
  break;
case Irc.REQUESTED_DISCONNECT:
result="Requested";
break;
case Irc.ERROR_CONNECTION_CLOSED:
result="";
break;
case Irc.ERROR_REGISTRATION_FAILED:
result="Failed to complete login.";
break;
case Irc.ERROR_SOCKET_TIMEOUT:
result="Connection timed out.";
break;
case Irc.SSL_ERROR:
result="Could not established secure connection (" + reasonMessage + ")";
break;
case Irc.ERROR_SOCKET_ERROR:
result=reasonMessage;
break;
}
if (!result.isEmpty()) {
result=" (" + result + ")";
}
return result;
}

public static String makeDisconnectReason ( int reason , String reasonMessage ) { String result = "" ; switch ( reason ) { case Irc . ERROR_UNKNOWN_HOST : result = "Unknown host" ; break ; case Irc . REQUESTED_DISCONNECT : result = "Requested" ; break ; case Irc . ERROR_CONNECTION_CLOSED : result = "" ; break ; case Irc . ERROR_REGISTRATION_FAILED : result = "Failed to complete login." ; break ; case Irc . ERROR_SOCKET_TIMEOUT : result = "Connection timed out." ; break ; case Irc . SSL_ERROR : result = "Could not established secure connection (" + reasonMessage + ")" ; break ; case Irc . ERROR_SOCKET_ERROR : result = reasonMessage ; break ; } if ( ! result . isEmpty ( ) ) { result = " (" + result + ")" ; } return result ; }
makes a readable message out of the given reason code .
