public boolean join ( ) { Message joinMessage = new Message ( MessageType . JOIN , this . channelName ) ; List < Message > response ; try { response = connection . request ( MessageFilters . message ( MessageType . RPL_NAMREPLY , null , "=" , channelName ) , MessageFilters . message ( MessageType . RPL_ENDOFNAMES , null , channelName ) , joinMessage ) ; } catch ( InterruptedException e ) { return false ; } List < String > names = new ArrayList < String > ( ) ; for ( Message message : response ) { if ( message . getType ( ) == MessageType . RPL_NAMREPLY ) { String [ ] args = message . getArgs ( ) ; for ( String name : args [ args . length - 1 ] . split ( " " ) ) { names . add ( name . replaceFirst ( "^[@+]" , "" ) ) ; } } } this . names = names ; return true ; }
Perform the join to the channel . Returns once the join operation is complete