summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2014-02-25 02:10:45 +0100
committerFlorent Le Coz <louiz@louiz.org>2014-02-25 02:10:45 +0100
commit76b131e13a842657b899d8852efb0f92b2d32145 (patch)
treecab2ebbb28995535e50490267a0cf93b4b51eaa0 /src/irc/irc_client.cpp
parentf6029d5bcf9f529d72e0846661f555e189669b26 (diff)
downloadbiboumi-76b131e13a842657b899d8852efb0f92b2d32145.tar.gz
biboumi-76b131e13a842657b899d8852efb0f92b2d32145.tar.bz2
biboumi-76b131e13a842657b899d8852efb0f92b2d32145.tar.xz
biboumi-76b131e13a842657b899d8852efb0f92b2d32145.zip
Do not try to connect to an irc server if we are connected or connecting
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index d35437c..232b87f 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -27,6 +27,8 @@ IrcClient::~IrcClient()
void IrcClient::start()
{
+ if (this->connected || this->connecting)
+ return ;
this->bridge->send_xmpp_message(this->hostname, "", std::string("Connecting to ") +
this->hostname + ":" + "6667");
this->connect(this->hostname, "6667");
@@ -144,8 +146,7 @@ void IrcClient::send_quit_command(const std::string& reason)
void IrcClient::send_join_command(const std::string& chan_name)
{
- if (!this->connected)
- this->start();
+ this->start();
if (this->welcomed == false)
this->channels_to_join.push_back(chan_name);
else