summaryrefslogtreecommitdiff
path: root/src/irc/irc_client.cpp
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-06-17 15:16:49 +0200
committerlouiz’ <louiz@louiz.org>2018-06-17 15:16:49 +0200
commit2f0e26db4cd91037463e5aa45c7538a942a9eee2 (patch)
treea06a8d0876f70fc9dc388fc7c3a81f5e434aeccd /src/irc/irc_client.cpp
parent354c738dc3cacd302d6961617fbc69e128572470 (diff)
downloadbiboumi-2f0e26db4cd91037463e5aa45c7538a942a9eee2.tar.gz
biboumi-2f0e26db4cd91037463e5aa45c7538a942a9eee2.tar.bz2
biboumi-2f0e26db4cd91037463e5aa45c7538a942a9eee2.tar.xz
biboumi-2f0e26db4cd91037463e5aa45c7538a942a9eee2.zip
Channels’ disco#info includes the number of participants
fix #3311
Diffstat (limited to 'src/irc/irc_client.cpp')
-rw-r--r--src/irc/irc_client.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/irc/irc_client.cpp b/src/irc/irc_client.cpp
index d7fa2cd..0f3d43c 100644
--- a/src/irc/irc_client.cpp
+++ b/src/irc/irc_client.cpp
@@ -317,9 +317,21 @@ IrcChannel* IrcClient::get_channel(const std::string& n)
}
catch (const std::out_of_range& exception)
{
- this->channels.emplace(name, std::make_unique<IrcChannel>());
+ return this->channels.emplace(name, std::make_unique<IrcChannel>()).first->second.get();
+ }
+}
+
+const IrcChannel* IrcClient::find_channel(const std::string& n) const
+{
+ const std::string name = utils::tolower(n);
+ try
+ {
return this->channels.at(name).get();
}
+ catch (const std::out_of_range& exception)
+ {
+ return nullptr;
+ }
}
bool IrcClient::is_channel_joined(const std::string& name)