* and the details of the channel they have left is available in the variable Channel *channel
* @param user The user who is parting
* @param channel The channel being parted
- * @param partmessage The part message, or an empty string
+ * @param partmessage The part message, or an empty string (may be modified)
* @param silent Change this to true if you want to conceal the PART command from the other users
* of the channel (useful for modules such as auditorium)
*/
- virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent);
+ virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
/** Called on rehash.
* This method is called prior to a /REHASH or when a SIGHUP is received from the operating
/* Channel::PartUser
* remove a channel from a users record, and return the number of users left.
* Therefore, if this function returns 0 the caller should delete the Channel.
+ *
+ * XXX: bleh, string copy of reason, fixme! -- w00t
*/
long Channel::PartUser(User *user, const char* reason)
{
bool silent = false;
+ std::string freason;
+
+ if (reason)
+ freason = reason;
+ else
+ freason = "";
if (!user)
return this->GetUserCounter();
UCListIter i = user->chans.find(this);
if (i != user->chans.end())
{
- FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, reason ? reason : "", silent));
+ FOREACH_MOD(I_OnUserPart,OnUserPart(user, this, freason, silent));
if (!silent)
this->WriteChannel(user, "PART %s%s%s", this->name.c_str(), reason ? " :" : "", reason ? reason : "");
void Module::OnUserDisconnect(User*) { }
void Module::OnUserJoin(User*, Channel*, bool, bool&) { }
void Module::OnPostJoin(User*, Channel*) { }
-void Module::OnUserPart(User*, Channel*, const std::string&, bool&) { }
+void Module::OnUserPart(User*, Channel*, std::string&, bool&) { }
void Module::OnRehash(User*, const std::string&) { }
void Module::OnServerRaw(std::string&, bool, User*) { }
int Module::OnUserPreJoin(User*, Channel*, const char*, std::string&, const std::string&) { return 0; }
}
}
- void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
+ void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
{
if (channel->IsModeSet('u'))
{
user->Shrink("cm_protect_"+std::string(chan->name));
}
- virtual void OnUserPart(User* user, Channel* channel, const std::string &partreason, bool &silent)
+ virtual void OnUserPart(User* user, Channel* channel, std::string &partreason, bool &silent)
{
// FIX: when someone parts a channel we must remove their Extensibles!
user->Shrink("cm_founder_"+std::string(channel->name));
}
}
- void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
+ void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
{
if (channel->IsModeSet('D'))
{
ServerInstance->Logs->Log("m_foobar",DEBUG,"Foobar: User "+b+" joined "+c);
}
- virtual void OnUserPart(User* user, Channel* channel, const std::string &partreason, bool &silent)
+ virtual void OnUserPart(User* user, Channel* channel, std::string &partreason, bool &silent)
{
// method called when a user parts a channel
conf = new ConfigReader(ServerInstance);
}
- void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
+ void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
{
if (user->IsModeSet('Q'))
{
}
- virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
+ virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
{
if (!IS_LOCAL(user))
return;
-#if 0
if (channel->IsExtBanned(user, 'p'))
partmessage = "";
-#endif
return;
}
Utils->DoOneToMany(user->uuid,"FNAME",params);
}
-void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent)
+void ModuleSpanningTree::OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent)
{
if (IS_LOCAL(user))
{
virtual void OnUserJoin(User* user, Channel* channel, bool sync, bool &silent);
virtual void OnChangeHost(User* user, const std::string &newhost);
virtual void OnChangeName(User* user, const std::string &gecos);
- virtual void OnUserPart(User* user, Channel* channel, const std::string &partmessage, bool &silent);
+ virtual void OnUserPart(User* user, Channel* channel, std::string &partmessage, bool &silent);
virtual void OnUserQuit(User* user, const std::string &reason, const std::string &oper_message);
virtual void OnUserPostNick(User* user, const std::string &oldnick);
virtual void OnUserKick(User* source, User* user, Channel* chan, const std::string &reason, bool &silent);