Constify the parameter arguments in ListModeBase's Tell* methods.

This commit is contained in:
Sadie Powell 2022-04-17 14:57:41 +01:00
parent b6c77b3e01
commit d45fe55f0e
2 changed files with 6 additions and 6 deletions

View File

@ -167,7 +167,7 @@ public:
* @param channel Channel the parameter is being added to
* @param parameter The actual parameter being added
*/
virtual void TellListTooLong(LocalUser* source, Channel* channel, std::string& parameter);
virtual void TellListTooLong(LocalUser* source, Channel* channel, const std::string& parameter);
/** Tell the user an item is already on the list.
* Overridden by implementing module.
@ -175,7 +175,7 @@ public:
* @param channel Channel the parameter is being added to
* @param parameter The actual parameter being added
*/
virtual void TellAlreadyOnList(LocalUser* source, Channel* channel, std::string& parameter);
virtual void TellAlreadyOnList(LocalUser* source, Channel* channel, const std::string& parameter);
/** Tell the user that the parameter is not in the list.
* Overridden by implementing module.
@ -183,7 +183,7 @@ public:
* @param channel Channel the parameter is being removed from
* @param parameter The actual parameter being removed
*/
virtual void TellNotSet(LocalUser* source, Channel* channel, std::string& parameter);
virtual void TellNotSet(LocalUser* source, Channel* channel, const std::string& parameter);
};
inline ListModeBase::ModeList* ListModeBase::GetList(Channel* channel)

View File

@ -223,17 +223,17 @@ void ListModeBase::OnParameterMissing(User* source, User* dest, Channel* channel
// Intentionally left blank.
}
void ListModeBase::TellListTooLong(LocalUser* source, Channel* channel, std::string& parameter)
void ListModeBase::TellListTooLong(LocalUser* source, Channel* channel, const std::string& parameter)
{
source->WriteNumeric(ERR_BANLISTFULL, channel->name, parameter, mode, InspIRCd::Format("Channel %s list is full", name.c_str()));
}
void ListModeBase::TellAlreadyOnList(LocalUser* source, Channel* channel, std::string& parameter)
void ListModeBase::TellAlreadyOnList(LocalUser* source, Channel* channel, const std::string& parameter)
{
source->WriteNumeric(ERR_LISTMODEALREADYSET, channel->name, parameter, mode, InspIRCd::Format("Channel %s list already contains %s", name.c_str(), parameter.c_str()));
}
void ListModeBase::TellNotSet(LocalUser* source, Channel* channel, std::string& parameter)
void ListModeBase::TellNotSet(LocalUser* source, Channel* channel, const std::string& parameter)
{
source->WriteNumeric(ERR_LISTMODENOTSET, channel->name, parameter, mode, InspIRCd::Format("Channel %s list does not contain %s", name.c_str(), parameter.c_str()));
}