check config

This commit is contained in:
2018-11-23 15:27:21 +01:00
parent 3c1aeda3de
commit 2164b44782

View File

@@ -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);
}
}