mirror of
https://github.com/moparisthebest/Yaaic
synced 2025-01-09 20:58:02 -05:00
IRCConnection: Implemented setAutojoinChannels()
This commit is contained in:
parent
4e683a9717
commit
ace19fe095
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user