mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-10 11:09:04 -04:00
Added support for part messages in the module API (and therefore between servers too)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2815 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
7254428c00
commit
7e6dfdf211
@ -353,8 +353,9 @@ class Module : public classbase
|
||||
* and the details of the channel they have left is available in the variable chanrec *channel
|
||||
* @param user The user who is parting
|
||||
* @param channel The channel being parted
|
||||
* @param partmessage The part message, or an empty string
|
||||
*/
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel);
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel, std::string partmessage);
|
||||
|
||||
/** Called on rehash.
|
||||
* This method is called prior to a /REHASH or when a SIGHUP is received from the operating
|
||||
|
@ -404,7 +404,6 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool
|
||||
if (!Ptr)
|
||||
return NULL;
|
||||
|
||||
FOREACH_MOD(I_OnUserPart,OnUserPart(user,Ptr));
|
||||
log(DEBUG,"del_channel: removing: %s %s",user->nick,Ptr->name);
|
||||
|
||||
for (unsigned int i =0; i < user->chans.size(); i++)
|
||||
@ -414,10 +413,12 @@ chanrec* del_channel(userrec *user, const char* cname, const char* reason, bool
|
||||
{
|
||||
if (reason)
|
||||
{
|
||||
FOREACH_MOD(I_OnUserPart,OnUserPart(user,Ptr,reason));
|
||||
WriteChannel(Ptr,user,"PART %s :%s",Ptr->name, reason);
|
||||
}
|
||||
else
|
||||
{
|
||||
FOREACH_MOD(I_OnUserPart,OnUserPart(user,Ptr,""));
|
||||
WriteChannel(Ptr,user,"PART :%s",Ptr->name);
|
||||
}
|
||||
user->chans[i].uc_modes = 0;
|
||||
|
@ -223,7 +223,7 @@ void Module::OnUserConnect(userrec* user) { }
|
||||
void Module::OnUserQuit(userrec* user, std::string message) { }
|
||||
void Module::OnUserDisconnect(userrec* user) { }
|
||||
void Module::OnUserJoin(userrec* user, chanrec* channel) { }
|
||||
void Module::OnUserPart(userrec* user, chanrec* channel) { }
|
||||
void Module::OnUserPart(userrec* user, chanrec* channel, std::string partmessage) { }
|
||||
void Module::OnRehash(std::string parameter) { }
|
||||
void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }
|
||||
int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; }
|
||||
|
@ -72,7 +72,7 @@ class ModuleChanFilter : public Module
|
||||
output = temp2.substr(0,temp2.length()-1);
|
||||
}
|
||||
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel)
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel, std::string partreason)
|
||||
{
|
||||
// when the last user parts, delete the list
|
||||
if (Srv->CountUsers(channel) == 1)
|
||||
|
@ -85,7 +85,7 @@ class ModuleChanProtect : public Module
|
||||
user->Shrink("cm_protect_"+std::string(chan->name));
|
||||
}
|
||||
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel)
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel, std::string partreason)
|
||||
{
|
||||
// FIX: when someone parts a channel we must remove their Extensibles!
|
||||
user->Shrink("cm_founder_"+std::string(channel->name));
|
||||
|
@ -86,7 +86,7 @@ class ModuleFoobar : public Module
|
||||
Srv->Log(DEBUG,"Foobar: User " + b + " joined " + c);
|
||||
}
|
||||
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel)
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel, std::string partreason)
|
||||
{
|
||||
// method called when a user parts a channel
|
||||
|
||||
|
@ -2988,12 +2988,14 @@ class ModuleSpanningTree : public Module
|
||||
DoOneToMany(user->nick,"FNAME",params);
|
||||
}
|
||||
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel)
|
||||
virtual void OnUserPart(userrec* user, chanrec* channel, std::string partmessage)
|
||||
{
|
||||
if (user->fd > -1)
|
||||
{
|
||||
std::deque<std::string> params;
|
||||
params.push_back(channel->name);
|
||||
if (partmessage != "")
|
||||
params.push_back(":"+partmessage);
|
||||
DoOneToMany(user->nick,"PART",params);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user