summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/modules.h10
-rw-r--r--src/channels.cpp1
-rw-r--r--src/cmd_modules.cpp2
-rw-r--r--src/modules.cpp1
4 files changed, 12 insertions, 2 deletions
diff --git a/include/modules.h b/include/modules.h
index 26b7d5014..5506cc214 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -342,7 +342,7 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnPostConnect, I_OnAddBan, I_OnDelBan,
I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
- I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList, I_OnPostCommand };
+ I_OnOperCompare, I_OnChannelDelete, I_OnPostOper, I_OnSyncOtherMetaData, I_OnSetAway, I_OnCancelAway, I_OnUserList, I_OnPostCommand, I_OnPostJoin };
/** Base class for all InspIRCd modules
* This class is the base class for InspIRCd modules. All modules must inherit from this class,
@@ -444,6 +444,14 @@ class Module : public Extensible
*/
virtual void OnUserJoin(userrec* user, chanrec* channel);
+ /** Called after a user joins a channel
+ * Identical to OnUserJoin, but called immediately afterwards, when any linking module has
+ * seen the join.
+ * @param user The user who is joining
+ * @param channel The channel being joined
+ */
+ virtual void OnPostJoin(userrec* user, chanrec* channel);
+
/** Called when a user parts a channel.
* The details of the leaving user are available to you in the parameter userrec *user,
* and the details of the channel they have left is available in the variable chanrec *channel
diff --git a/src/channels.cpp b/src/channels.cpp
index 3f74698d5..de698883f 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -427,6 +427,7 @@ chanrec* chanrec::ForceChan(InspIRCd* Instance, chanrec* Ptr,ucrec *a,userrec* u
Ptr->UserList(user);
}
FOREACH_MOD_I(Instance,I_OnUserJoin,OnUserJoin(user,Ptr));
+ FOREACH_MOD_I(Instance,I_OnPostJoin,OnPostJoin(user,Ptr));
return Ptr;
}
diff --git a/src/cmd_modules.cpp b/src/cmd_modules.cpp
index 3e7f63399..c2fe71f70 100644
--- a/src/cmd_modules.cpp
+++ b/src/cmd_modules.cpp
@@ -34,7 +34,7 @@ char* itab[] = {
"OnPostLocalTopicChange", "OnEvent", "OnRequest", "OnOperCompre", "OnGlobalOper", "OnPostConnect", "OnAddBan", "OnDelBan",
"OnRawSocketAccept", "OnRawSocketClose", "OnRawSocketWrite", "OnRawSocketRead", "OnChangeLocalUserGECOS", "OnUserRegister",
"OnOperCompare", "OnChannelDelete", "OnPostOper", "OnSyncOtherMetaData", "OnSetAway", "OnCancelAway", "OnNamesList",
- "OnPostCommand", NULL
+ "OnPostCommand", "OnPostJoin", NULL
};
extern "C" command_t* init_command(InspIRCd* Instance)
diff --git a/src/modules.cpp b/src/modules.cpp
index faee68075..2b62ba382 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -110,6 +110,7 @@ void Module::OnUserConnect(userrec* user) { }
void Module::OnUserQuit(userrec* user, const std::string& message) { }
void Module::OnUserDisconnect(userrec* user) { }
void Module::OnUserJoin(userrec* user, chanrec* channel) { }
+void Module::OnPostJoin(userrec* user, chanrec* channel) { }
void Module::OnUserPart(userrec* user, chanrec* channel, const std::string &partmessage) { }
void Module::OnRehash(const std::string &parameter) { }
void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { }