only join one channel

This commit is contained in:
2018-11-23 14:46:09 +01:00
parent 90f7af7bdc
commit 51e80a6aad
2 changed files with 7 additions and 6 deletions

View File

@@ -31,11 +31,9 @@ void IrcPlugin::activate(Scheduler *scheduler)
client->setCallback(bind(&IrcPlugin::callback, this, _1));
client->setSentCallback(bind(&IrcPlugin::debugSentCallback, this, _1));
String channel = "#illucat";
subscribe("irc/connect", bind(&IrcPlugin::connect, this));
subscribe("irc/join", bind(&IrcPlugin::join, this, _1));
subscribe("irc/sendMessage", bind(&IrcPlugin::sendMessage, this, channel, _1));
subscribe("irc/sendMessage", bind(&IrcPlugin::sendMessage, this, _1));
//enableConnectTask(scheduler);
enableProcessTask(scheduler);
@@ -84,9 +82,11 @@ void IrcPlugin::join(String channel)
}
}
void IrcPlugin::sendMessage(String to, String msg)
void IrcPlugin::sendMessage(String msg)
{
client->sendMessage(to, msg);
if(channel){
client->sendMessage(channel, msg);
}
}
void IrcPlugin::callback(IRCMessage ircMessage)