File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
main/java/org/kitteh/irc/client/library/defaults/listener
test/java/org/kitteh/irc/client/library/defaults Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,9 @@ public DefaultISupportListener(Client.@NonNull WithManagement client) {
4848 @ Handler (priority = Integer .MAX_VALUE - 1 )
4949 public void iSupport (ClientReceiveNumericEvent event ) {
5050 for (int i = 1 ; i < event .getParameters ().size (); i ++) {
51+ if ((i == event .getParameters ().size () - 1 ) && event .getParameters ().get (i ).contains (" " )) {
52+ continue ;
53+ }
5154 ISupportParameter parameter = this .getClient ().getISupportManager ().createParameter (event .getParameters ().get (i ));
5255 this .getClient ().getServerInfo ().addISupportParameter (parameter );
5356 this .fire (new ISupportParameterEvent (this .getClient (), event .getSource (), parameter ));
Original file line number Diff line number Diff line change @@ -204,6 +204,17 @@ public void test5ISUPPORT() {
204204 Mockito .verify (this .serverInfo , Mockito .times (5 )).addISupportParameter (Mockito .any ());
205205 }
206206
207+ @ Test
208+ public void test5ISUPPORTLonger () {
209+ this .fireLine (":irc.network 005 Kitteh SAFELIST ELIST=CTU CHANTYPES=# EXCEPTS INVEX :are supported by this server" );
210+ Mockito .verify (this .serverInfo , Mockito .times (1 )).addISupportParameter (Mockito .argThat (this .iSupportParameter ("SAFELIST" )));
211+ Mockito .verify (this .serverInfo , Mockito .times (1 )).addISupportParameter (Mockito .argThat (this .iSupportParameter ("ELIST" )));
212+ Mockito .verify (this .serverInfo , Mockito .times (1 )).addISupportParameter (Mockito .argThat (this .iSupportParameter ("CHANTYPES" )));
213+ Mockito .verify (this .serverInfo , Mockito .times (1 )).addISupportParameter (Mockito .argThat (this .iSupportParameter ("EXCEPTS" )));
214+ Mockito .verify (this .serverInfo , Mockito .times (1 )).addISupportParameter (Mockito .argThat (this .iSupportParameter ("INVEX" )));
215+ Mockito .verify (this .serverInfo , Mockito .times (5 )).addISupportParameter (Mockito .any ());
216+ }
217+
207218 @ Test
208219 public void testMOTD () {
209220 this .fireLine (":irc.network 375 Kitteh :- irc.network Message of the Day -" );
You can’t perform that action at this time.
0 commit comments