Channels’ disco#info includes the number of participants

fix #3311
This commit is contained in:
louiz’
2018-06-17 15:16:49 +02:00
parent 354c738dc3
commit 2f0e26db4c
5 changed files with 67 additions and 4 deletions
+13 -1
View File
@@ -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)
+4
View File
@@ -67,6 +67,10 @@ public:
* Return the channel with this name, create it if it does not yet exist
*/
IrcChannel* get_channel(const std::string& name);
/**
* Return the channel with this name. Nullptr if it is not found
*/
const IrcChannel* find_channel(const std::string& name) const;
/**
* Returns true if the channel is joined
*/