continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r574249 - /maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Date Mon, 10 Sep 2007 13:43:32 GMT
Author: evenisse
Date: Mon Sep 10 06:43:31 2007
New Revision: 574249

URL: http://svn.apache.org/viewvc?rev=574249&view=rev
Log:
- Fix alternate nick connection
use IRCConstants value instead of an int

Modified:
    maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java

Modified: maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java?rev=574249&r1=574248&r2=574249&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-notifiers/continuum-notifier-irc/src/main/java/org/apache/maven/continuum/notification/irc/IrcContinuumNotifier.java
Mon Sep 10 06:43:31 2007
@@ -33,6 +33,7 @@
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
 import org.codehaus.plexus.util.StringUtils;
 import org.schwering.irc.lib.IRCConnection;
+import org.schwering.irc.lib.IRCConstants;
 import org.schwering.irc.lib.IRCEventListener;
 import org.schwering.irc.lib.IRCModeParser;
 import org.schwering.irc.lib.IRCUser;
@@ -139,7 +140,17 @@
 
     private String getConnectionKey( String host, int port, String nick, String alternateNick
)
     {
-        return host.toUpperCase() + Integer.toString( port ) + nick.toUpperCase() + alternateNick.toUpperCase();
+        String nickname = nick;
+        String alternateNickName = alternateNick;
+        if ( nick == null )
+        {
+            nickname = "null";
+        }
+        if ( alternateNick == null )
+        {
+            alternateNickName = "null";
+        }
+        return host.toUpperCase() + Integer.toString( port ) + nickname.toUpperCase() + alternateNickName.toUpperCase();
     }
 
     private void checkConnection( IRCConnection conn, String key )
@@ -434,7 +445,7 @@
         public void onError( int num, String msg )
         {
             getLogger().error( "Error #" + num + ": " + msg );
-            if ( num == 433 )
+            if ( num == IRCConstants.ERR_NICKNAMEINUSE )
             {
                 if ( alternateNick != null )
                 {



Mime
View raw message