int SetTopic(User *u, std::string &t, bool forceset = false);
/** Obtain the channel "user counter"
- * This returns the channel reference counter, which is initialized
- * to 0 when the channel is created and incremented/decremented
- * upon joins, parts quits and kicks.
+ * This returns the number of users on this channel
*
* @return The number of users on this channel
*/
- long GetUserCounter();
+ long GetUserCounter() const { return userlist.size(); }
/** Add a user pointer to the internal reference list
* @param user The user to add
*
* @return This function returns pointer to a map of User pointers (CUList*).
*/
- const UserMembList* GetUsers();
+ const UserMembList* GetUsers() const { return &userlist; }
/** Returns true if the user given is on the given channel.
* @param user The user to look for
*/
ModResult GetExtBanStatus(User *u, char type);
};
+
+inline bool Channel::HasUser(User* user)
+{
+ return (userlist.find(user) != userlist.end());
+}
/** Get server ID as string with required leading zeroes
*/
- const std::string& GetSID();
+ const std::string& GetSID() const { return sid; }
/** Read the entire configuration into memory
* and initialize this class. All other methods
/** Get the joined sequence
* @return A constant reference to the joined string
*/
- const std::string& GetJoined() const;
+ const std::string& GetJoined() const { return joined; }
};
/** irc::modestacker stacks mode sequences into a list.
/** Return a count of channels on the network
* @return The number of channels
*/
- long ChannelCount();
+ long ChannelCount() const { return chanlist->size(); }
/** Send an error notice to all local users, opered and unopered
* @param s The error string to send
return Version(cmd.name, VF_VENDOR|VF_CORE);
}
};
+
+inline void InspIRCd::SendMode(const std::vector<std::string>& parameters, User* user)
+{
+ this->Modes->Process(parameters, user);
+}
/**
* Returns true if the mode is a list mode
*/
- bool IsListMode();
+ bool IsListMode() const { return list; }
/**
* Mode prefix or 0. If this is defined, you should
* also implement GetPrefixRank() to return an integer
* may be different to what you sent after it has been 'cleaned up' by the parser.
* @return Last parsed string, as seen by users.
*/
- const std::string& GetLastParse();
+ const std::string& GetLastParse() const { return LastParse; }
const std::vector<std::string>& GetLastParseParams() { return LastParseParams; }
const std::vector<TranslateType>& GetLastParseTranslate() { return LastParseTranslate; }
/** Add a mode to the mode parser.
return CMD_SUCCESS;
}
-long Channel::GetUserCounter()
-{
- return userlist.size();
-}
-
Membership* Channel::AddUser(User* user)
{
Membership*& memb = userlist[user];
}
}
-bool Channel::HasUser(User* user)
-{
- return (userlist.find(user) != userlist.end());
-}
-
Membership* Channel::GetUser(User* user)
{
UserMembIter i = userlist.find(user);
return i->second;
}
-const UserMembList* Channel::GetUsers()
-{
- return &userlist;
-}
-
void Channel::SetDefaultModes()
{
ServerInstance->Logs->Log("CHANNELS", LOG_DEBUG, "SetDefaultModes %s",
return (p != name ? ++p : p);
}
-const std::string& ServerConfig::GetSID()
-{
- return sid;
-}
-
void ConfigReaderThread::Run()
{
Config->Read();
joined.append(sequence[end]);
}
-const std::string& irc::stringjoiner::GetJoined() const
-{
- return joined;
-}
-
irc::portparser::portparser(const std::string &source, bool allow_overlapped)
: sep(source), in_range(0), range_begin(0), range_end(0), overlapped(allow_overlapped)
{
}
}
-/* return channel count */
-long InspIRCd::ChannelCount()
-{
- return chanlist->size();
-}
-
bool InspIRCd::IsValidMask(const std::string &mask)
{
const char* dest = mask.c_str();
{
}
-bool ModeHandler::IsListMode()
-{
- return list;
-}
-
unsigned int ModeHandler::GetPrefixRank()
{
return 0;
}
}
-const std::string& ModeParser::GetLastParse()
-{
- return LastParse;
-}
-
void ModeParser::CleanMask(std::string &mask)
{
std::string::size_type pos_of_pling = mask.find_first_of('!');
value = NULL;
}
-void InspIRCd::SendMode(const std::vector<std::string>& parameters, User *user)
-{
- this->Modes->Process(parameters, user);
-}
-
-
void InspIRCd::SendGlobalMode(const std::vector<std::string>& parameters, User *user)
{
Modes->Process(parameters, user);