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/join", bind(&IrcPlugin::join, this, _1));
|
||||||
subscribe("irc/sendMessage", bind(&IrcPlugin::sendMessage, 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);
|
//enableConnectTask(scheduler);
|
||||||
enableProcessTask(scheduler);
|
enableProcessTask(scheduler);
|
||||||
PRINT_MSG(Serial, "IRC", "plugin activated");
|
PRINT_MSG(Serial, "IRC", "plugin activated");
|
||||||
@@ -87,9 +92,10 @@ void IrcPlugin::join(String c)
|
|||||||
|
|
||||||
void IrcPlugin::sendMessage(String msg)
|
void IrcPlugin::sendMessage(String msg)
|
||||||
{
|
{
|
||||||
if(channel){
|
if (channel)
|
||||||
|
{
|
||||||
client->sendMessage(channel, msg);
|
client->sendMessage(channel, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IrcPlugin::callback(IRCMessage ircMessage)
|
void IrcPlugin::callback(IRCMessage ircMessage)
|
||||||
|
|||||||
Reference in New Issue
Block a user