1
0
mirror of https://github.com/moparisthebest/Yaaic synced 2025-01-10 05:08:18 -05: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 IRCService service;
private Server server; private Server server;
private String[] autojoinChannels;
/** /**
* Create a new connection * Create a new connection
@ -89,6 +90,16 @@ public class IRCConnection extends PircBot
this.setVersion(realname); this.setVersion(realname);
} }
/**
* Set channels to autojoin after connect
*
* @param channels
*/
public void setAutojoinChannels(String[] channels)
{
autojoinChannels = channels;
}
/** /**
* On version (CTCP version) * On version (CTCP version)
* *
@ -139,6 +150,13 @@ public class IRCConnection extends PircBot
); );
service.sendBroadcast(intent); service.sendBroadcast(intent);
if (autojoinChannels != null) {
for (String channel : autojoinChannels) {
// Add support for channel keys
joinChannel(channel);
}
}
} }
/** /**