diff --git a/src/urChatBasic/backend/MessageHandler.java b/src/urChatBasic/backend/MessageHandler.java index d2739e1..547a1f5 100644 --- a/src/urChatBasic/backend/MessageHandler.java +++ b/src/urChatBasic/backend/MessageHandler.java @@ -684,8 +684,7 @@ public void messageExec (Message myMessage) // CAP ACK or CAP LS? switch (myMessage.subType) { - case "LS" -> - { + case "LS" -> { printServerText(myMessage.body); serverBase.setCapabilities(myMessage.body); @@ -706,8 +705,7 @@ public void messageExec (Message myMessage) serverBase.nickservRequestAuthentication(); } } - case "ACK" -> - { + case "ACK" -> { printServerText("Begin SASL Authentication"); serverBase.saslDoAuthentication(); } @@ -733,20 +731,21 @@ public class NoticeMessage implements MessageBase @Override public void messageExec (Message myMessage) { - if (myMessage.nick != null && myMessage.nick.equalsIgnoreCase("NickServ")) + // Send the message to the Channel or Private Channel if that is where it needs to go + // otherwise just print it as server text + IRCChannelBase messageChannel = myMessage.messageHandler.serverBase.getCreatedChannel(myMessage.getChannel()); + + if (messageChannel == null) { - printPrivateText(myMessage.nick, myMessage.body, myMessage.nick); - serverBase.reconnectChannels(); + messageChannel = myMessage.messageHandler.serverBase.getCreatedPrivateChannel(myMessage.getNick()); + } + + if (messageChannel != null) + { + messageChannel.printText(myMessage.getBody(), Constants.EVENT_USER); } else { - IRCChannelBase messageChannel = myMessage.messageHandler.serverBase.getCreatedChannel(myMessage.getChannel()); - if (messageChannel != null) - { - messageChannel.printText(myMessage.getBody(), Constants.EVENT_USER); - } else - { - printServerText(myMessage.body); - } + printServerText(myMessage.body); } } } @@ -818,10 +817,11 @@ public class DisconnectErrorMessage implements MessageBase public void messageExec (Message myMessage) { // Are we just quitting, then don't show an error message. - if(myMessage.getBody().contains("Goodbye cruel world")) + if (myMessage.getBody().contains("Goodbye cruel world")) { gui.quitServer(myMessage.messageHandler.serverBase); - } else { + } else + { Constants.LOGGER.error(myMessage.getBody()); MessageDialog dialog = new MessageDialog("startUp() failed! " + myMessage.getBody(), "Error", JOptionPane.ERROR_MESSAGE); dialog.setVisible(true); diff --git a/src/urChatBasic/base/Constants.java b/src/urChatBasic/base/Constants.java index a3b1131..b78079e 100644 --- a/src/urChatBasic/base/Constants.java +++ b/src/urChatBasic/base/Constants.java @@ -27,7 +27,7 @@ */ public class Constants { - public static String UR_VERSION = "v0.6.0"; + public static String UR_VERSION = "v0.7.0"; public static String APP_NAME = "urChatClient" + UR_VERSION; public static String URL_SEPARATOR = "/"; public static final String RESOURCES_PATH = URL_SEPARATOR + "resources" + URL_SEPARATOR; @@ -130,7 +130,7 @@ public class Constants public static final Boolean DEFAULT_USERS_LIST_ACTIVE = true; public static final Boolean DEFAULT_EVENT_TICKER_JOINS_QUITS = true; public static final Boolean DEFAULT_MAIN_WINDOW_JOINS_QUITS = true; - public static final Boolean DEFAULT_LOAD_CHANNEL_LOGS_ON_JOIN = true; + public static final Boolean DEFAULT_LOAD_CHANNEL_LOGS_ON_JOIN = false; public static final Boolean DEFAULT_LOG_CHANNEL_ACTIVITY = true; public static final Boolean DEFAULT_LOG_SERVER_ACTIVITY = true; public static final Boolean DEFAULT_AUTO_CONNECT_FAVOURITES = false; diff --git a/src/urChatBasic/frontend/IRCServer.java b/src/urChatBasic/frontend/IRCServer.java index b4087e5..2e3097a 100644 --- a/src/urChatBasic/frontend/IRCServer.java +++ b/src/urChatBasic/frontend/IRCServer.java @@ -531,7 +531,7 @@ public IRCChannelBase getCreatedChannel (String channelName, boolean asPrivate) IRCChannelBase returnChannel = null; for (IRCChannelBase tempChannel : createdChannels) - if (tempChannel.getName().equals(channelName)) + if (tempChannel.getName().equalsIgnoreCase(channelName)) { if (asPrivate && tempChannel instanceof IRCPrivate || !asPrivate) returnChannel = tempChannel;