mirror of
https://gitlab.com/wirelos/sprocket-plugin-irc.git
synced 2025-12-14 21:42:21 +01:00
check config
This commit is contained in:
@@ -35,6 +35,11 @@ void IrcPlugin::activate(Scheduler *scheduler)
|
||||
subscribe("irc/join", bind(&IrcPlugin::join, this, _1));
|
||||
subscribe("irc/sendMessage", bind(&IrcPlugin::sendMessage, this, _1));
|
||||
|
||||
if (server.length() == 0 || port == 0 || nick.length() == 0 || user.length() == 0)
|
||||
{
|
||||
publish("irc/needsConfig", "");
|
||||
}
|
||||
|
||||
//enableConnectTask(scheduler);
|
||||
enableProcessTask(scheduler);
|
||||
PRINT_MSG(Serial, "IRC", "plugin activated");
|
||||
@@ -87,7 +92,8 @@ void IrcPlugin::join(String c)
|
||||
|
||||
void IrcPlugin::sendMessage(String msg)
|
||||
{
|
||||
if(channel){
|
||||
if (channel)
|
||||
{
|
||||
client->sendMessage(channel, msg);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user