diff options
Diffstat (limited to 'src/bridge/bridge.cpp')
-rw-r--r-- | src/bridge/bridge.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp index a0964df..c2ac11f 100644 --- a/src/bridge/bridge.cpp +++ b/src/bridge/bridge.cpp @@ -4,6 +4,7 @@ #include <irc/irc_message.hpp> #include <network/poller.hpp> #include <utils/encoding.hpp> +#include <utils/tolower.hpp> #include <logger/logger.hpp> #include <utils/split.hpp> #include <stdexcept> @@ -369,3 +370,20 @@ void Bridge::remove_preferred_from_jid(const std::string& nick) if (it != this->preferred_user_from.end()) this->preferred_user_from.erase(it); } + +void Bridge::add_waiting_iq(iq_responder_callback_t&& callback) +{ + this->waiting_iq.emplace_back(std::move(callback)); +} + +void Bridge::trigger_response_iq(const std::string& irc_hostname, const IrcMessage& message) +{ + auto it = this->waiting_iq.begin(); + while (it != this->waiting_iq.end()) + { + if ((*it)(irc_hostname, message) == true) + it = this->waiting_iq.erase(it); + else + ++it; + } +} |