summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2015-09-21 18:56:37 +0200
committerFlorent Le Coz <louiz@louiz.org>2015-09-21 18:56:37 +0200
commitceec98907776dcd73b0c02a46ca135196e5f223e (patch)
tree9e37f0052cd3a0e98b50fff1b9c39456ee3d395b /src/irc
parent890cfe90996ac4c3916c84d178049d9b3b23465b (diff)
downloadbiboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.gz
biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.bz2
biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.tar.xz
biboumi-ceec98907776dcd73b0c02a46ca135196e5f223e.zip
Add a field (in the configure form) to specifiy an after-connect IRC command
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/irc_client.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index c6174bf..26f9a46 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -226,6 +226,7 @@ void IrcClient::send_message(IrcMessage&& message)
void IrcClient::send_raw(const std::string& txt)
{
+ log_debug("IRC SENDING (raw): (" << this->get_hostname() << ") " << txt);
this->send_data(txt + "\r\n");
}
@@ -608,6 +609,12 @@ void IrcClient::on_welcome_message(const IrcMessage& message)
{
this->current_nick = message.arguments[0];
this->welcomed = true;
+#ifdef USE_DATABASE
+ auto options = Database::get_irc_server_options(this->bridge->get_bare_jid(),
+ this->get_hostname());
+ if (!options.afterConnectionCommand.value().empty())
+ this->send_raw(options.afterConnectionCommand.value());
+#endif
// Install a repeated events to regularly send a PING
TimedEventsManager::instance().add_event(TimedEvent(240s, std::bind(&IrcClient::send_ping_command, this),
"PING"s + this->hostname + this->bridge->get_jid()));