1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2024-08-13 16:53:50 -04:00

IRCConnection: Implemented setAutojoinChannels()

This commit is contained in:
Sebastian Kaspari 2010-04-12 21:38:35 +02:00
parent 4e683a9717
commit ace19fe095

View File

@ -49,6 +49,7 @@ public class IRCConnection extends PircBot
{
private IRCService service;
private Server server;
private String[] autojoinChannels;
/**
* Create a new connection
@ -88,6 +89,16 @@ public class IRCConnection extends PircBot
// The real "version" value is provided by onVersion()
this.setVersion(realname);
}
/**
* Set channels to autojoin after connect
*
* @param channels
*/
public void setAutojoinChannels(String[] channels)
{
autojoinChannels = channels;
}
/**
* On version (CTCP version)
@ -139,6 +150,13 @@ public class IRCConnection extends PircBot
);
service.sendBroadcast(intent);
if (autojoinChannels != null) {
for (String channel : autojoinChannels) {
// Add support for channel keys
joinChannel(channel);
}
}
}
/**