summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-06-19 22:21:49 +0200
committerFlorent Le Coz <louiz@louiz.org>2014-06-19 22:21:49 +0200
commit26ffc8fe121e03e1b663aa0015a71b0fc914f95e (patch)
tree098ca791e05911ecdc7ae22620c263669e37f7d3 /src/irc/irc_client.cpp
parenta705b9af7b1bbce6b6c94788398a4cff9cad9ec9 (diff)
downloadbiboumi-26ffc8fe121e03e1b663aa0015a71b0fc914f95e.tar.gz
biboumi-26ffc8fe121e03e1b663aa0015a71b0fc914f95e.tar.bz2
biboumi-26ffc8fe121e03e1b663aa0015a71b0fc914f95e.tar.xz
biboumi-26ffc8fe121e03e1b663aa0015a71b0fc914f95e.zip
Implement a way to add callbacks, waiting for an IRC event to return an iq
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index cc54971..d179aaa 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -136,8 +136,11 @@ void IrcClient::parse_in_buffer(const size_t)
if (pos == std::string::npos)
break ;
IrcMessage message(this->in_buf.substr(0, pos));
- log_debug("IRC RECEIVING: " << message);
this->in_buf = this->in_buf.substr(pos + 2, std::string::npos);
+ log_debug("IRC RECEIVING: " << message);
+
+ // Call the standard callback (if any), associated with the command
+ // name that we just received.
auto cb = irc_callbacks.find(message.command);
if (cb != irc_callbacks.end())
{
@@ -149,6 +152,8 @@ void IrcClient::parse_in_buffer(const size_t)
}
else
log_info("No handler for command " << message.command);
+ // Try to find a waiting_iq, which response will be triggered by this IrcMessage
+ this->bridge->trigger_response_iq(this->hostname, message);
}
}