-
- return NULL;
-}
-
-/* find a channel record by channel name and return a pointer to it */
-chanrec* InspIRCd::FindChan(const char* chan)
-{
- chan_hash::iterator iter = chanlist->find(chan);
-
- if (iter == chanlist->end())
- /* Couldn't find it */
- return NULL;
-
- return iter->second;
-}
-
-chanrec* InspIRCd::FindChan(const std::string &chan)
-{
- chan_hash::iterator iter = chanlist->find(chan);
-
- if (iter == chanlist->end())
- /* Couldn't find it */
- return NULL;
-
- return iter->second;
-}
-
-/* Send an error notice to all users, registered or not */
-void InspIRCd::SendError(const std::string &s)
-{
- for (std::vector<userrec*>::const_iterator i = this->local_users.begin(); i != this->local_users.end(); i++)
- {
- if ((*i)->registered == REG_ALL)
- {
- (*i)->WriteServ("NOTICE %s :%s",(*i)->nick,s.c_str());
- }
- else
- {
- /* Unregistered connections receive ERROR, not a NOTICE */
- (*i)->Write("ERROR :" + s);
- }
- /* This might generate a whole load of EAGAIN, but we dont really
- * care about this, as if we call SendError something catastrophic
- * has occured anyway, and we wont receive the events for these.
- */
- (*i)->FlushWriteBuf();
- }
-}
-
-/* this function counts all users connected, wether they are registered or NOT. */
-int InspIRCd::UserCount()
-{
- return clientlist->size();
-}
-
-/* this counts only registered users, so that the percentages in /MAP don't mess up when users are sitting in an unregistered state */
-int InspIRCd::RegisteredUserCount()
-{
- return clientlist->size() - this->UnregisteredUserCount();
-}
-
-/* return how many users have a given mode e.g. 'a' */
-int InspIRCd::ModeCount(const char mode)
-{
- ModeHandler* mh = this->Modes->FindMode(mode, MODETYPE_USER);
-
- if (mh)
- return mh->GetCount();
- else
- return 0;
-}
-
-/* wrapper for readability */
-int InspIRCd::InvisibleUserCount()
-{
- return ModeCount('i');
-}
-
-/* return how many users are opered */
-int InspIRCd::OperCount()
-{
- return this->all_opers.size();
-}
-
-/* return how many users are unregistered */
-int InspIRCd::UnregisteredUserCount()
-{
- return this->unregistered_count;
-}
-
-/* return channel count */
-long InspIRCd::ChannelCount()
-{
- return chanlist->size();
-}
-
-/* return how many local registered users there are */
-long InspIRCd::LocalUserCount()
-{
- /* Doesnt count unregistered clients */
- return (local_users.size() - this->UnregisteredUserCount());