mirror of
https://gitlab.com/wirelos/sprocket-plugin-irc.git
synced 2025-12-14 21:42:21 +01:00
only join one channel
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -32,6 +32,7 @@ private:
|
||||
int port;
|
||||
String nick;
|
||||
String user;
|
||||
String channel;
|
||||
|
||||
void applyConfig(IrcConfig cfg);
|
||||
void applyConfigFromFile(const char *fileName);
|
||||
@@ -41,7 +42,7 @@ private:
|
||||
virtual void callback(IRCMessage ircMessage);
|
||||
virtual void debugSentCallback(String data);
|
||||
void join(String channel);
|
||||
void sendMessage(String to, String msg);
|
||||
void sendMessage(String msg);
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user