summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2017-01-25 19:55:45 +0100
committerlouiz’ <louiz@louiz.org>2017-01-25 19:55:45 +0100
commit45f7396c8d30ed37570c4ecdaa886388f9beba3e (patch)
treedfc24ecd25e41280cf69d25c9361dd746874c37b /src/bridge
parentb660a4736778cde8d0805390ffa857b77c271757 (diff)
downloadbiboumi-45f7396c8d30ed37570c4ecdaa886388f9beba3e.tar.gz
biboumi-45f7396c8d30ed37570c4ecdaa886388f9beba3e.tar.bz2
biboumi-45f7396c8d30ed37570c4ecdaa886388f9beba3e.tar.xz
biboumi-45f7396c8d30ed37570c4ecdaa886388f9beba3e.zip
Cancel the IRC server linger timer when we try to-rejoin a channel on it
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp7
-rw-r--r--src/bridge/bridge.hpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index cafcbc3..573e8d7 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -169,6 +169,7 @@ bool Bridge::join_irc_channel(const Iid& iid, const std::string& nickname, const
const std::string& resource)
{
const auto hostname = iid.get_server();
+ this->cancel_linger_timer(hostname);
IrcClient* irc = this->make_irc_client(hostname, nickname);
this->add_resource_to_server(hostname, resource);
auto res_in_chan = this->is_resource_in_chan(ChannelKey{iid.get_local(), hostname}, resource);
@@ -1232,3 +1233,9 @@ void Bridge::quit_or_start_linger_timer(const std::string& irc_hostname)
}, event_name);
TimedEventsManager::instance().add_event(std::move(event));
}
+
+void Bridge::cancel_linger_timer(const std::string& irc_hostname)
+{
+ const auto event_name = "IRCLINGER:" + irc_hostname + ".." + this->get_bare_jid();
+ TimedEventsManager::instance().cancel(event_name);
+}
diff --git a/src/bridge/bridge.hpp b/src/bridge/bridge.hpp
index 7d0166c..b165650 100644
--- a/src/bridge/bridge.hpp
+++ b/src/bridge/bridge.hpp
@@ -241,6 +241,7 @@ public:
* configured linger time is expired.
*/
void quit_or_start_linger_timer(const std::string& irc_hostname);
+ void cancel_linger_timer(const std::string& irc_hostname);
private:
/**